very-happy-cli 0.2.159 → 0.2.161

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 (259) hide show
  1. package/dist/{AcpBackend-VsfkZiVF.mjs → AcpBackend-6U6pQgx1.mjs} +4 -2
  2. package/dist/{AcpBackend-DUYFlyfN.cjs → AcpBackend-Ba98QDif.cjs} +78 -76
  3. package/dist/{AcpSessionManager-Bdv8LWXh.cjs → AcpSessionManager-BAY1Pggx.cjs} +9 -9
  4. package/dist/{AcpSessionManager-rYtVb0kN.mjs → AcpSessionManager-CoMWFVw3.mjs} +1 -1
  5. package/dist/BasePermissionHandler-2R0uH2CI.cjs +157 -0
  6. package/dist/BasePermissionHandler-BvvhBTja.mjs +155 -0
  7. package/dist/BaseReasoningProcessor-DyhO1uoU.mjs +198 -0
  8. package/dist/BaseReasoningProcessor-fsVNmCEF.cjs +200 -0
  9. package/dist/RemoteModeDisplay-D-HewyXg.mjs +150 -0
  10. package/dist/RemoteModeDisplay-NC1gPHtj.cjs +153 -0
  11. package/dist/agentAttachments-Dbw8iMCZ.cjs +20 -0
  12. package/dist/agentAttachments-M_B5qEF2.mjs +18 -0
  13. package/dist/agentGuidance-B5NATuFa.cjs +28 -0
  14. package/dist/agentGuidance-CQuNlNx8.mjs +20 -0
  15. package/dist/{agentHome-CvsJyeQB.mjs → agentHome-Ck1i1TQB.mjs} +8 -22
  16. package/dist/{agentHome-CHh4lmjM.cjs → agentHome-DvNnGphb.cjs} +14 -28
  17. package/dist/api-B2vLMS-z.cjs +3346 -0
  18. package/dist/api-SffjRQ1b.mjs +3339 -0
  19. package/dist/{types-Dh-s4Lqs.mjs → apiMachine-BpW9t8MO.mjs} +9116 -16205
  20. package/dist/{types-BbvK1Tr_.cjs → apiMachine-gFA54X7y.cjs} +9104 -16247
  21. package/dist/assistantTools-BfA0R3_m.cjs +380 -0
  22. package/dist/assistantTools-CgiTbnWb.mjs +376 -0
  23. package/dist/attachmentContent-CSGxr71v.mjs +82 -0
  24. package/dist/attachmentContent-DMMZzevR.cjs +88 -0
  25. package/dist/attachmentLimits-CzVrqgLR.cjs +354 -0
  26. package/dist/attachmentLimits-yba1uHFO.mjs +348 -0
  27. package/dist/auth-Bt4ceBBy.cjs +227 -0
  28. package/dist/auth-CYHjQ8oQ.mjs +225 -0
  29. package/dist/auth-DdyVZSo6.mjs +218 -0
  30. package/dist/auth-x4CEoysH.cjs +220 -0
  31. package/dist/authRelay-BdYkC1Po.cjs +156 -0
  32. package/dist/authRelay-DSAvg1uv.mjs +143 -0
  33. package/dist/{auto-DKmEls8Z.cjs → auto-BDXDUnjB.cjs} +70 -79
  34. package/dist/{auto-nb8GhRRy.mjs → auto-CXLlRi3a.mjs} +27 -36
  35. package/dist/backgroundTaskActivity-8PdPxrvy.mjs +149 -0
  36. package/dist/backgroundTaskActivity-CBvUdj39.cjs +157 -0
  37. package/dist/bootstrap-BNQq05jR.mjs +112 -0
  38. package/dist/bootstrap-CkgIq8N3.cjs +116 -0
  39. package/dist/browser-9pyhQr1R.mjs +20 -0
  40. package/dist/browser-BDOlKWYe.cjs +22 -0
  41. package/dist/claudeCliPath-BqkaH2oR.mjs +8 -0
  42. package/dist/claudeCliPath-U4HHmV4r.cjs +10 -0
  43. package/dist/claudeLocal-BDuGFnjJ.cjs +343 -0
  44. package/dist/claudeLocal-CQa8qnwq.mjs +339 -0
  45. package/dist/claudeLocalLauncher-Bd5I2-j6.cjs +154 -0
  46. package/dist/claudeLocalLauncher-CDqQI9ak.mjs +152 -0
  47. package/dist/cliUpdate-DsKXPFYp.cjs +120 -0
  48. package/dist/cliUpdate-Y34VGe9Y.mjs +112 -0
  49. package/dist/client-Brn-UwVk.mjs +100 -0
  50. package/dist/client-CXb1VJui.mjs +112 -0
  51. package/dist/client-C_axwRry.cjs +104 -0
  52. package/dist/client-DOBWJL3u.cjs +119 -0
  53. package/dist/codex/happyMcpStdioBridge.cjs +33 -14
  54. package/dist/codex/happyMcpStdioBridge.mjs +26 -7
  55. package/dist/codexAppServerClient-ZzhUTWPo.cjs +1090 -0
  56. package/dist/codexAppServerClient-oeQKD6Qf.mjs +1088 -0
  57. package/dist/codexCommand-C7H0NpBe.cjs +2088 -0
  58. package/dist/codexCommand-CJ82bl3l.mjs +2086 -0
  59. package/dist/codexThreadFork-BCaEMBiM.mjs +338 -0
  60. package/dist/codexThreadFork-BZqF-9bX.cjs +350 -0
  61. package/dist/{config-ClLtM6F3.mjs → config-BglnktIo.mjs} +7 -40
  62. package/dist/{config-DLx-vW3I.cjs → config-CYpL1Ahd.cjs} +26 -59
  63. package/dist/configuration-DoWFJUPm.mjs +170 -0
  64. package/dist/configuration-v9f8LM9T.cjs +181 -0
  65. package/dist/connect-hgcNjyAB.mjs +682 -0
  66. package/dist/connect-yEvjdRvx.cjs +684 -0
  67. package/dist/constants-BC4St0xd.mjs +11 -0
  68. package/dist/constants-VJ0N6WuG.cjs +17 -0
  69. package/dist/contentLogMetadata-BlWI0egu.mjs +51 -0
  70. package/dist/contentLogMetadata-ZSFk_NjQ.cjs +54 -0
  71. package/dist/context-B45vMtSZ.cjs +69 -0
  72. package/dist/context-C9GHPLEm.mjs +65 -0
  73. package/dist/controlClient-DjoKTtgK.mjs +260 -0
  74. package/dist/controlClient-fEHE85bH.cjs +279 -0
  75. package/dist/createSessionMetadata-BRLB9CNO.cjs +58 -0
  76. package/dist/createSessionMetadata-mIeehclp.mjs +54 -0
  77. package/dist/defaultPermissionMode-BnxJPVHT.mjs +4 -0
  78. package/dist/defaultPermissionMode-CxmTXUQR.cjs +7 -0
  79. package/dist/detectCLI-CSGMlV51.mjs +58 -0
  80. package/dist/detectCLI-DR9ZaN6B.cjs +61 -0
  81. package/dist/deterministicJson-DKDP_mM-.cjs +507 -0
  82. package/dist/deterministicJson-p835AdAU.mjs +502 -0
  83. package/dist/doctor-BPkYWSuq.mjs +75 -0
  84. package/dist/doctor-BeUuQXFs.mjs +391 -0
  85. package/dist/doctor-hVNnSZJn.cjs +395 -0
  86. package/dist/doctor-u46qYYKX.cjs +79 -0
  87. package/dist/doctorReadiness-BCZGcN0a.cjs +151 -0
  88. package/dist/doctorReadiness-C208SMN9.mjs +142 -0
  89. package/dist/editPaths-BVfS_FFL.mjs +68 -0
  90. package/dist/editPaths-Bqp4OFPw.cjs +73 -0
  91. package/dist/ensureDaemonRunning-CO7d1gOC.mjs +61 -0
  92. package/dist/ensureDaemonRunning-Dg9aZfjs.cjs +64 -0
  93. package/dist/handleResumeCommand-BiTPK0qd.mjs +240 -0
  94. package/dist/handleResumeCommand-DnVmy7a3.cjs +245 -0
  95. package/dist/ids-B6ZC0HGt.cjs +13 -0
  96. package/dist/ids-DU6sLx4C.mjs +10 -0
  97. package/dist/index-B6UGRQ7h.mjs +102 -0
  98. package/dist/{index-2mCaeKyf.mjs → index-CAFwetLk.mjs} +68 -38
  99. package/dist/index-Cqx-Raq6.mjs +68 -0
  100. package/dist/index-D3kI0hDR.cjs +107 -0
  101. package/dist/index-DA7yINuk.cjs +994 -0
  102. package/dist/{index-BEOMECtE.cjs → index-LIn6nCcq.cjs} +121 -91
  103. package/dist/index-Pf2cV9cn.cjs +182 -0
  104. package/dist/index-SPGPenK5.mjs +158 -0
  105. package/dist/index-gNTWtSKN.cjs +71 -0
  106. package/dist/index-qdS1friN.mjs +949 -0
  107. package/dist/index.cjs +5 -46
  108. package/dist/index.mjs +5 -46
  109. package/dist/{install-BPhJppvd.mjs → install-BO_W7VhL.mjs} +37 -37
  110. package/dist/install-Bu85vlHD.cjs +88 -0
  111. package/dist/install-ClUUl3yp.mjs +86 -0
  112. package/dist/{install-BOHrUaFM.cjs → install-Cs5qAPrB.cjs} +38 -38
  113. package/dist/{installPiTools-DuZ6jZvX.cjs → installPiTools-BKnXjrVu.cjs} +2 -3
  114. package/dist/{installPiTools-Cj7yU9Fc.mjs → installPiTools-B_CdM5_2.mjs} +1 -2
  115. package/dist/{installTerminalHooks-Cou3WUf3.cjs → installTerminalHooks-BQZbvxsZ.cjs} +5 -40
  116. package/dist/{installTerminalHooks-WeznjkuC.mjs → installTerminalHooks-By7gBMEF.mjs} +3 -38
  117. package/dist/lib.cjs +28 -19
  118. package/dist/lib.d.cts +12 -2
  119. package/dist/lib.d.mts +12 -2
  120. package/dist/lib.mjs +23 -14
  121. package/dist/lidState-C2dI0FAN.mjs +297 -0
  122. package/dist/lidState-KHHu1015.cjs +305 -0
  123. package/dist/limits-C-a7gr04.cjs +43 -0
  124. package/dist/limits-DIo7rEBR.mjs +36 -0
  125. package/dist/localHappyAgentAuth-BXiHPXdC.cjs +86 -0
  126. package/dist/localHappyAgentAuth-DCsetiyG.mjs +82 -0
  127. package/dist/logger-Bc8-u1w0.cjs +275 -0
  128. package/dist/logger-fXoNzNuB.mjs +271 -0
  129. package/dist/loginShellEnv-BkuYtExZ.cjs +182 -0
  130. package/dist/loginShellEnv-Dw8M7tkI.mjs +167 -0
  131. package/dist/machineMetadata-BHjehxJY.mjs +38 -0
  132. package/dist/machineMetadata-BibDMFVx.cjs +41 -0
  133. package/dist/main-BktM4A1K.mjs +939 -0
  134. package/dist/main-CLaX-t-b.cjs +941 -0
  135. package/dist/manager-BQ4flvQZ.mjs +101 -0
  136. package/dist/manager-Cly8xVIR.cjs +105 -0
  137. package/dist/{mcp-Dy3f_K0h.mjs → mcp-CeUd9KDr.mjs} +27 -33
  138. package/dist/{mcp-CPYbtsYG.cjs → mcp-GBfE70nk.cjs} +42 -48
  139. package/dist/messageBuffer-BWlGgR3A.mjs +71 -0
  140. package/dist/messageBuffer-fJMH6uY8.cjs +73 -0
  141. package/dist/mirrorProtocol-BNLtoWjO.mjs +170 -0
  142. package/dist/mirrorProtocol-BUtmg1ws.cjs +186 -0
  143. package/dist/oneShotPrompts-CL0dip9C.cjs +16 -0
  144. package/dist/oneShotPrompts-DT4p6RNd.mjs +12 -0
  145. package/dist/package-Cl5BEP5x.cjs +173 -0
  146. package/dist/package-uOg9SCKi.mjs +171 -0
  147. package/dist/path-B7zW-WwE.cjs +18 -0
  148. package/dist/path-D2wdaNSk.mjs +15 -0
  149. package/dist/peerTools-CIeiy9wn.cjs +283 -0
  150. package/dist/peerTools-Dz3_7Bkk.mjs +272 -0
  151. package/dist/permissionMode-CH4FoZfU.mjs +80 -0
  152. package/dist/permissionMode-CrV-XuMs.cjs +87 -0
  153. package/dist/persistence-CBNMzSa8.cjs +414 -0
  154. package/dist/persistence-oET5n61f.mjs +372 -0
  155. package/dist/piExtension.mjs +2 -1
  156. package/dist/piRunnerArgs-Bf7RUF__.cjs +66 -0
  157. package/dist/piRunnerArgs-Dk1ncwHF.mjs +59 -0
  158. package/dist/{piRuntime-NtF0YqjH.cjs → piRuntime-B_6TE9Eb.cjs} +4 -4
  159. package/dist/{piRuntime-kLZNpAAl.mjs → piRuntime-BwRdhK_N.mjs} +2 -2
  160. package/dist/{piTerminal-B0fEOV_2.mjs → piTerminal-Bap3R8Re.mjs} +32 -35
  161. package/dist/{piTerminal-9J0GAKzb.cjs → piTerminal-CagmEoez.cjs} +32 -35
  162. package/dist/previewPath-B0rBdhy1.cjs +83 -0
  163. package/dist/previewPath-CXN4Vag0.mjs +81 -0
  164. package/dist/projectPath-BTBIMB57.mjs +10 -0
  165. package/dist/projectPath-ChLhdOyt.cjs +13 -0
  166. package/dist/registerCommonHandlers-BjSV2Skz.cjs +538 -0
  167. package/dist/registerCommonHandlers-CrgvJsOy.mjs +536 -0
  168. package/dist/registerKillSessionHandler-6TC2S3lf.cjs +366 -0
  169. package/dist/registerKillSessionHandler-Cbc8Rgtd.mjs +363 -0
  170. package/dist/remoteSessionClient-BNx78NLb.cjs +634 -0
  171. package/dist/remoteSessionClient-CO7qOjR0.mjs +612 -0
  172. package/dist/resources-BdFBQi8r.mjs +117 -0
  173. package/dist/resources-JDPugcDq.cjs +120 -0
  174. package/dist/run-2l5vSt2h.mjs +5743 -0
  175. package/dist/run-D5xAEWSB.cjs +5766 -0
  176. package/dist/runClaude-BX6ixjtW.cjs +894 -0
  177. package/dist/runClaude-BgN6xo05.mjs +892 -0
  178. package/dist/runClaudeDeps-Bp20MScE.cjs +4168 -0
  179. package/dist/runClaudeDeps-COBBhD9o.mjs +4129 -0
  180. package/dist/{runGemini-F-mqx3_K.cjs → runGemini-CSMPkt0p.cjs} +202 -175
  181. package/dist/{runGemini-DV6Ouadt.mjs → runGemini-Cc2jq-uh.mjs} +58 -31
  182. package/dist/{runOpenClaw-D7MlPS5n.mjs → runOpenClaw-CIlCwdW2.mjs} +31 -32
  183. package/dist/{runOpenClaw-Qqo9j63M.cjs → runOpenClaw-YBwua4Rf.cjs} +64 -65
  184. package/dist/sandbox-C4gXLP1p.cjs +187 -0
  185. package/dist/sandbox-CNkwOtHI.mjs +180 -0
  186. package/dist/selfCheck-CU8xSDsl.cjs +87 -0
  187. package/dist/selfCheck-hJ6PCh7v.mjs +84 -0
  188. package/dist/{send-CLhYXNgy.mjs → send-CGHcKZ-w.mjs} +12 -5
  189. package/dist/{send-4qJTCAYW.cjs → send-DY9Nr-x4.cjs} +16 -9
  190. package/dist/server-II51Mimf.cjs +407 -0
  191. package/dist/server-m2b5pamZ.mjs +404 -0
  192. package/dist/sessionLock-7ePAYDOg.cjs +205 -0
  193. package/dist/sessionLock-Cw6FmbMv.mjs +197 -0
  194. package/dist/sessionModeFile-BVCV5f7E.cjs +36 -0
  195. package/dist/sessionModeFile-CDmDyRkD.mjs +32 -0
  196. package/dist/sessionOps-C_f1wKOr.mjs +760 -0
  197. package/dist/sessionOps-DJdExmBy.cjs +783 -0
  198. package/dist/sessionScanner-CaAHLyNV.mjs +206 -0
  199. package/dist/sessionScanner-D1goKdd3.cjs +209 -0
  200. package/dist/{sessions-Bh1pyddi.cjs → sessions-DGs6ALNo.cjs} +37 -28
  201. package/dist/{sessions-CzIH2rGp.mjs → sessions-DnvmWUel.mjs} +17 -8
  202. package/dist/setupOfflineReconnection-CVViqZft.mjs +72 -0
  203. package/dist/setupOfflineReconnection-R7XuR_sj.cjs +74 -0
  204. package/dist/smallFastModel-BLNgMrwR.mjs +18 -0
  205. package/dist/smallFastModel-D_uxGMo3.cjs +21 -0
  206. package/dist/{spawn-CmFOSVdW.cjs → spawn-CXTH7qg1.cjs} +61 -65
  207. package/dist/{spawn-CPIWlPOM.mjs → spawn-DNYSvFtC.mjs} +35 -40
  208. package/dist/spawnAgents-BGQiEF-w.cjs +52 -0
  209. package/dist/spawnAgents-DZzZ9jMI.mjs +45 -0
  210. package/dist/spawnHappyCLI-BhYj84rv.cjs +66 -0
  211. package/dist/spawnHappyCLI-cqWQbwsb.mjs +64 -0
  212. package/dist/specialCommands-BSqhYg5X.mjs +52 -0
  213. package/dist/specialCommands-DSsTeRej.cjs +54 -0
  214. package/dist/startFileWatcher-CKKx-8ZO.cjs +71 -0
  215. package/dist/startFileWatcher-CdegMbJj.mjs +69 -0
  216. package/dist/startupPlan-BLMbfQIH.cjs +12 -0
  217. package/dist/startupPlan-DFMyNgAs.mjs +10 -0
  218. package/dist/streamRelay-BiKw59Cc.cjs +233 -0
  219. package/dist/streamRelay-FPVbHpbM.mjs +231 -0
  220. package/dist/sync-CVk4QERO.cjs +71 -0
  221. package/dist/sync-CxD-w_40.mjs +69 -0
  222. package/dist/systemPrompt-BygJcmbi.cjs +97 -0
  223. package/dist/systemPrompt-DmtypUc7.mjs +94 -0
  224. package/dist/{teams-CEahj4cm.mjs → teams-BOC6nIPL.mjs} +9 -40
  225. package/dist/{teams-CB1R9-Z9.cjs → teams-BsvpOBfn.cjs} +14 -45
  226. package/dist/template-BaHAmH2K.cjs +129 -0
  227. package/dist/template-CiOPa2rd.mjs +121 -0
  228. package/dist/{terminalTitleSuggest-DKgX3osW.mjs → terminalTitleSuggest-CeKsX_V6.mjs} +1 -9
  229. package/dist/{terminalTitleSuggest-Dji8I0Jy.cjs → terminalTitleSuggest-DhvRFX3H.cjs} +0 -10
  230. package/dist/terminals-B_bfC9c2.cjs +250 -0
  231. package/dist/terminals-Dlg0x3nY.mjs +235 -0
  232. package/dist/time-BZNdNiIV.mjs +38 -0
  233. package/dist/time-CNRE4ChD.cjs +42 -0
  234. package/dist/titleGenerator-CFRhU-xq.cjs +172 -0
  235. package/dist/titleGenerator-ox6ptCsp.mjs +166 -0
  236. package/dist/tmuxSocket-B8Yx20sT.mjs +19 -0
  237. package/dist/tmuxSocket-D-Xt6Vn-.cjs +24 -0
  238. package/dist/{todo-DqyRI4wP.cjs → todo-B-KB7oAB.cjs} +15 -12
  239. package/dist/{todo-Cknp5D4U.mjs → todo-C5KBVbUw.mjs} +11 -8
  240. package/dist/tools-BZabNIid.mjs +177 -0
  241. package/dist/tools-BmQQUATY.mjs +60 -0
  242. package/dist/tools-CsSovyNp.cjs +180 -0
  243. package/dist/tools-lMDra4Pv.cjs +63 -0
  244. package/dist/trimIdent-4gvk9Wk6.cjs +22 -0
  245. package/dist/trimIdent-BAjmv_TG.mjs +20 -0
  246. package/dist/types-CRS-srZK.cjs +66 -0
  247. package/dist/types-CkqAACXx.mjs +64 -0
  248. package/dist/uninstall-B1WLtC1d.mjs +47 -0
  249. package/dist/uninstall-fvA5aWpU.cjs +49 -0
  250. package/package.json +7 -7
  251. package/scripts/session_hook_forwarder.cjs +9 -2
  252. package/dist/agentGuidance-BRDN1NoZ.cjs +0 -2217
  253. package/dist/agentGuidance-KgvYuF3R.mjs +0 -2145
  254. package/dist/index-BF6WfgV5.mjs +0 -19624
  255. package/dist/index-C-JazrMB.mjs +0 -52
  256. package/dist/index-blDSadUR.cjs +0 -58
  257. package/dist/index-rH3DrQ5B.cjs +0 -19688
  258. package/dist/limits-BH5CV5vR.cjs +0 -2683
  259. package/dist/limits-CjRj8IX5.mjs +0 -2558
package/dist/lib.cjs CHANGED
@@ -1,40 +1,49 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./types-BbvK1Tr_.cjs');
4
- var persistence = require('./limits-BH5CV5vR.cjs');
3
+ var api = require('./api-B2vLMS-z.cjs');
4
+ var logger = require('./logger-Bc8-u1w0.cjs');
5
+ var configuration = require('./configuration-v9f8LM9T.cjs');
6
+ var types = require('./types-CRS-srZK.cjs');
5
7
  require('axios');
6
8
  require('node:events');
7
9
  require('socket.io-client');
10
+ require('./attachmentLimits-CzVrqgLR.cjs');
8
11
  require('zod');
12
+ require('./index-DA7yINuk.cjs');
13
+ require('@paralleldrive/cuid2');
14
+ require('./authRelay-BdYkC1Po.cjs');
9
15
  require('node:crypto');
16
+ require('tweetnacl');
17
+ require('./limits-C-a7gr04.cjs');
18
+ require('./time-CNRE4ChD.cjs');
19
+ require('./lidState-KHHu1015.cjs');
20
+ require('os');
10
21
  require('child_process');
22
+ require('./registerCommonHandlers-BjSV2Skz.cjs');
11
23
  require('util');
12
24
  require('fs/promises');
13
25
  require('crypto');
14
26
  require('path');
15
27
  require('cross-spawn');
16
- require('./terminalTitleSuggest-Dji8I0Jy.cjs');
28
+ require('./projectPath-ChLhdOyt.cjs');
17
29
  require('url');
18
- require('os');
19
- require('@paralleldrive/cuid2');
30
+ require('./sync-CVk4QERO.cjs');
31
+ require('./backgroundTaskActivity-CBvUdj39.cjs');
32
+ require('./controlClient-fEHE85bH.cjs');
33
+ require('./persistence-CBNMzSa8.cjs');
20
34
  require('node:fs/promises');
21
- require('node:path');
22
- require('node:os');
23
- require('node:child_process');
24
- require('node-pty');
25
35
  require('node:fs');
26
- require('fs');
27
- require('tweetnacl');
28
- require('node:readline');
29
- require('@anthropic-ai/sandbox-runtime');
30
- require('expo-server-sdk');
36
+ require('./contentLogMetadata-ZSFk_NjQ.cjs');
31
37
  require('chalk');
32
38
  require('node:util');
39
+ require('node:path');
40
+ require('node:os');
41
+ require('./package-Cl5BEP5x.cjs');
33
42
 
34
43
 
35
44
 
36
- exports.ApiClient = index.ApiClient;
37
- exports.ApiSessionClient = index.ApiSessionClient;
38
- exports.RawJSONLinesSchema = index.RawJSONLinesSchema;
39
- exports.configuration = persistence.configuration;
40
- exports.logger = persistence.logger;
45
+ exports.ApiClient = api.ApiClient;
46
+ exports.ApiSessionClient = api.ApiSessionClient;
47
+ exports.logger = logger.logger;
48
+ exports.configuration = configuration.configuration;
49
+ exports.RawJSONLinesSchema = types.RawJSONLinesSchema;
package/dist/lib.d.cts CHANGED
@@ -1043,6 +1043,15 @@ type ACPMessageData = {
1043
1043
  [key: string]: unknown;
1044
1044
  };
1045
1045
  declare class ApiSessionClient extends EventEmitter {
1046
+ /**
1047
+ * B-512: the session socket now connects before the runner has attached its
1048
+ * `archived` listener (registerKillSessionHandler). An archive signal that
1049
+ * fires in that window must not be lost: remember it and replay it to any
1050
+ * listener attached later.
1051
+ */
1052
+ private archiveSignalled;
1053
+ emit(event: string | symbol, ...args: any[]): boolean;
1054
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
1046
1055
  private readonly token;
1047
1056
  readonly sessionId: string;
1048
1057
  private metadata;
@@ -1680,8 +1689,9 @@ type SessionNotificationKind = 'done' | 'permission' | 'question';
1680
1689
  declare class PushNotificationClient {
1681
1690
  private readonly token;
1682
1691
  private readonly baseUrl;
1683
- private readonly expo;
1692
+ private expoLoad;
1684
1693
  constructor(token: string, baseUrl?: string);
1694
+ private loadExpo;
1685
1695
  /**
1686
1696
  * Fetch all push tokens for the authenticated user.
1687
1697
  * Retries up to 3 times with exponential backoff on transient errors.
@@ -1807,7 +1817,7 @@ declare class ApiClient {
1807
1817
  sessionSyncClient(session: Session, opts?: {
1808
1818
  initialSeq?: number;
1809
1819
  }): ApiSessionClient;
1810
- machineSyncClient(machine: Machine): ApiMachineClient;
1820
+ machineSyncClient(machine: Machine): Promise<ApiMachineClient>;
1811
1821
  push(): PushNotificationClient;
1812
1822
  /**
1813
1823
  * Create an account-encrypted notification producer bound to a session.
package/dist/lib.d.mts CHANGED
@@ -1043,6 +1043,15 @@ type ACPMessageData = {
1043
1043
  [key: string]: unknown;
1044
1044
  };
1045
1045
  declare class ApiSessionClient extends EventEmitter {
1046
+ /**
1047
+ * B-512: the session socket now connects before the runner has attached its
1048
+ * `archived` listener (registerKillSessionHandler). An archive signal that
1049
+ * fires in that window must not be lost: remember it and replay it to any
1050
+ * listener attached later.
1051
+ */
1052
+ private archiveSignalled;
1053
+ emit(event: string | symbol, ...args: any[]): boolean;
1054
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
1046
1055
  private readonly token;
1047
1056
  readonly sessionId: string;
1048
1057
  private metadata;
@@ -1680,8 +1689,9 @@ type SessionNotificationKind = 'done' | 'permission' | 'question';
1680
1689
  declare class PushNotificationClient {
1681
1690
  private readonly token;
1682
1691
  private readonly baseUrl;
1683
- private readonly expo;
1692
+ private expoLoad;
1684
1693
  constructor(token: string, baseUrl?: string);
1694
+ private loadExpo;
1685
1695
  /**
1686
1696
  * Fetch all push tokens for the authenticated user.
1687
1697
  * Retries up to 3 times with exponential backoff on transient errors.
@@ -1807,7 +1817,7 @@ declare class ApiClient {
1807
1817
  sessionSyncClient(session: Session, opts?: {
1808
1818
  initialSeq?: number;
1809
1819
  }): ApiSessionClient;
1810
- machineSyncClient(machine: Machine): ApiMachineClient;
1820
+ machineSyncClient(machine: Machine): Promise<ApiMachineClient>;
1811
1821
  push(): PushNotificationClient;
1812
1822
  /**
1813
1823
  * Create an account-encrypted notification producer bound to a session.
package/dist/lib.mjs CHANGED
@@ -1,30 +1,39 @@
1
- export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema } from './types-Dh-s4Lqs.mjs';
2
- export { c as configuration, l as logger } from './limits-CjRj8IX5.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient } from './api-SffjRQ1b.mjs';
2
+ export { l as logger } from './logger-fXoNzNuB.mjs';
3
+ export { c as configuration } from './configuration-DoWFJUPm.mjs';
4
+ export { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
3
5
  import 'axios';
4
6
  import 'node:events';
5
7
  import 'socket.io-client';
8
+ import './attachmentLimits-yba1uHFO.mjs';
6
9
  import 'zod';
10
+ import './index-qdS1friN.mjs';
11
+ import '@paralleldrive/cuid2';
12
+ import './authRelay-DSAvg1uv.mjs';
7
13
  import 'node:crypto';
14
+ import 'tweetnacl';
15
+ import './limits-DIo7rEBR.mjs';
16
+ import './time-BZNdNiIV.mjs';
17
+ import './lidState-C2dI0FAN.mjs';
18
+ import 'os';
8
19
  import 'child_process';
20
+ import './registerCommonHandlers-CrgvJsOy.mjs';
9
21
  import 'util';
10
22
  import 'fs/promises';
11
23
  import 'crypto';
12
24
  import 'path';
13
25
  import 'cross-spawn';
14
- import './terminalTitleSuggest-DKgX3osW.mjs';
26
+ import './projectPath-BTBIMB57.mjs';
15
27
  import 'url';
16
- import 'os';
17
- import '@paralleldrive/cuid2';
28
+ import './sync-CxD-w_40.mjs';
29
+ import './backgroundTaskActivity-8PdPxrvy.mjs';
30
+ import './controlClient-DjoKTtgK.mjs';
31
+ import './persistence-oET5n61f.mjs';
18
32
  import 'node:fs/promises';
19
- import 'node:path';
20
- import 'node:os';
21
- import 'node:child_process';
22
- import 'node-pty';
23
33
  import 'node:fs';
24
- import 'fs';
25
- import 'tweetnacl';
26
- import 'node:readline';
27
- import '@anthropic-ai/sandbox-runtime';
28
- import 'expo-server-sdk';
34
+ import './contentLogMetadata-BlWI0egu.mjs';
29
35
  import 'chalk';
30
36
  import 'node:util';
37
+ import 'node:path';
38
+ import 'node:os';
39
+ import './package-uOg9SCKi.mjs';
@@ -0,0 +1,297 @@
1
+ import { l as logger } from './logger-fXoNzNuB.mjs';
2
+ import { e as encodeBase64, g as encrypt, h as decrypt, d as decodeBase64 } from './authRelay-DSAvg1uv.mjs';
3
+ import os from 'os';
4
+ import { execSync } from 'child_process';
5
+
6
+ function isRateQuotaCode(code) {
7
+ return typeof code === "string" && code.endsWith("_rate_quota_exceeded");
8
+ }
9
+ const RATE_RETRY_MIN_DELAY_MS = 2e3;
10
+ const RATE_RETRY_MAX_DELAY_MS = 6e4;
11
+ function rateRetryDelayMs(attempt, random = Math.random()) {
12
+ const exponent = Math.max(0, Math.min(attempt, 32) - 1);
13
+ const ceiling = Math.min(RATE_RETRY_MIN_DELAY_MS * 2 ** exponent, RATE_RETRY_MAX_DELAY_MS);
14
+ return Math.round(RATE_RETRY_MIN_DELAY_MS + random * (ceiling - RATE_RETRY_MIN_DELAY_MS));
15
+ }
16
+ async function pauseForRateQuota(opts) {
17
+ const ms = rateRetryDelayMs(opts.attempt);
18
+ opts.log?.(`[RATE] ${opts.label} write refused (${opts.code}), attempt ${opts.attempt} \u2014 waiting ${ms}ms`);
19
+ await opts.sleep(ms);
20
+ return ms;
21
+ }
22
+
23
+ class RpcHandlerManager {
24
+ handlers = /* @__PURE__ */ new Map();
25
+ /**
26
+ * B-506: methods whose params/result are PLAINTEXT JSON strings instead of
27
+ * machine-key ciphertext. The caller is a CLI on another machine of the
28
+ * same account, which holds neither this machine's key nor the account
29
+ * content key; the trusted relay sees the payload either way (this fork
30
+ * is server-trusted, not e2e). Only `registerPlainHandler` puts a method
31
+ * here; everything else keeps decrypting.
32
+ */
33
+ plainMethods = /* @__PURE__ */ new Set();
34
+ scopePrefix;
35
+ encryptionKey;
36
+ encryptionVariant;
37
+ logger;
38
+ sockets = /* @__PURE__ */ new Set();
39
+ constructor(config) {
40
+ this.scopePrefix = config.scopePrefix;
41
+ this.encryptionKey = config.encryptionKey;
42
+ this.encryptionVariant = config.encryptionVariant;
43
+ this.logger = config.logger || ((msg, data) => logger.debug(msg, data));
44
+ }
45
+ /**
46
+ * Register an RPC handler for a specific method
47
+ * @param method - The method name (without prefix)
48
+ * @param handler - The handler function
49
+ */
50
+ registerHandler(method, handler) {
51
+ const prefixedMethod = this.getPrefixedMethod(method);
52
+ this.handlers.set(prefixedMethod, handler);
53
+ for (const socket of this.sockets) socket.emit("rpc-register", { method: prefixedMethod });
54
+ }
55
+ unregisterHandler(method) {
56
+ const prefixedMethod = this.getPrefixedMethod(method);
57
+ this.handlers.delete(prefixedMethod);
58
+ this.plainMethods.delete(prefixedMethod);
59
+ for (const socket of this.sockets) socket.emit("rpc-unregister", { method: prefixedMethod });
60
+ }
61
+ /**
62
+ * B-506: register a method whose request is a plaintext JSON string and
63
+ * whose response is returned as a plaintext JSON string (see
64
+ * `plainMethods`). The handler receives the parsed params; a throw is
65
+ * answered with `{ error }` like the encrypted path.
66
+ */
67
+ registerPlainHandler(method, handler) {
68
+ this.plainMethods.add(this.getPrefixedMethod(method));
69
+ this.registerHandler(method, handler);
70
+ }
71
+ isPlainMethod(prefixedMethod) {
72
+ return this.plainMethods.has(prefixedMethod);
73
+ }
74
+ /**
75
+ * Handle an incoming RPC request
76
+ * @param request - The RPC request data
77
+ * @param callback - The response callback
78
+ */
79
+ async handleRequest(request) {
80
+ if (this.plainMethods.has(request.method)) {
81
+ return this.handlePlainRequest(request);
82
+ }
83
+ try {
84
+ const handler = this.handlers.get(request.method);
85
+ if (!handler) {
86
+ this.logger("[RPC] [ERROR] Method not found", { method: request.method });
87
+ const errorResponse = { error: "Method not found" };
88
+ const encryptedError = encodeBase64(encrypt(this.encryptionKey, this.encryptionVariant, errorResponse));
89
+ return encryptedError;
90
+ }
91
+ const decryptedParams = decrypt(this.encryptionKey, this.encryptionVariant, decodeBase64(request.params));
92
+ this.logger("[RPC] Calling handler", { method: request.method });
93
+ const result = await handler(decryptedParams);
94
+ this.logger("[RPC] Handler returned", { method: request.method, hasResult: result !== void 0 });
95
+ const encryptedResponse = encodeBase64(encrypt(this.encryptionKey, this.encryptionVariant, result));
96
+ this.logger("[RPC] Sending encrypted response", { method: request.method, responseLength: encryptedResponse.length });
97
+ return encryptedResponse;
98
+ } catch (error) {
99
+ this.logger("[RPC] [ERROR] Error handling request", { error });
100
+ const errorResponse = {
101
+ error: error instanceof Error ? error.message : "Unknown error"
102
+ };
103
+ return encodeBase64(encrypt(this.encryptionKey, this.encryptionVariant, errorResponse));
104
+ }
105
+ }
106
+ /** Plaintext variant of handleRequest (B-506). Never throws; never encrypts. */
107
+ async handlePlainRequest(request) {
108
+ const handler = this.handlers.get(request.method);
109
+ if (!handler) return JSON.stringify({ error: "Method not found" });
110
+ let params;
111
+ try {
112
+ params = typeof request.params === "string" && request.params.length > 0 ? JSON.parse(request.params) : {};
113
+ } catch {
114
+ return JSON.stringify({ error: "Invalid JSON params" });
115
+ }
116
+ try {
117
+ this.logger("[RPC] Calling plain handler", { method: request.method });
118
+ const result = await handler(params);
119
+ return JSON.stringify(result === void 0 ? null : result);
120
+ } catch (error) {
121
+ this.logger("[RPC] [ERROR] Error handling plain request", { error });
122
+ return JSON.stringify({ error: error instanceof Error ? error.message : "Unknown error" });
123
+ }
124
+ }
125
+ onSocketConnect(socket) {
126
+ this.sockets.add(socket);
127
+ for (const [prefixedMethod] of this.handlers) {
128
+ socket.emit("rpc-register", { method: prefixedMethod });
129
+ }
130
+ }
131
+ /**
132
+ * Attach a candidate transport and wait until the server confirms every
133
+ * method before a release handover closes the old transport.
134
+ */
135
+ async onSocketConnectAndWait(socket, timeoutMs = 1e4) {
136
+ this.sockets.add(socket);
137
+ const pending = new Set(this.handlers.keys());
138
+ const acknowledged = /* @__PURE__ */ new Set();
139
+ await new Promise((resolve, reject) => {
140
+ let settleTimer = null;
141
+ const timer = setTimeout(() => {
142
+ cleanup();
143
+ reject(new Error(`RPC registration timed out (${pending.size} pending)`));
144
+ }, timeoutMs);
145
+ timer.unref?.();
146
+ const maybeSettle = () => {
147
+ if (pending.size > 0 || settleTimer) return;
148
+ settleTimer = setTimeout(() => {
149
+ settleTimer = null;
150
+ for (const prefixedMethod of this.handlers.keys()) {
151
+ if (acknowledged.has(prefixedMethod) || pending.has(prefixedMethod)) continue;
152
+ pending.add(prefixedMethod);
153
+ socket.emit("rpc-register", { method: prefixedMethod });
154
+ }
155
+ if (pending.size === 0) {
156
+ cleanup();
157
+ resolve();
158
+ }
159
+ }, 0);
160
+ settleTimer.unref?.();
161
+ };
162
+ const onRegistered = (data) => {
163
+ if (typeof data?.method !== "string") return;
164
+ acknowledged.add(data.method);
165
+ pending.delete(data.method);
166
+ maybeSettle();
167
+ };
168
+ const cleanup = () => {
169
+ clearTimeout(timer);
170
+ if (settleTimer) clearTimeout(settleTimer);
171
+ socket.off("rpc-registered", onRegistered);
172
+ };
173
+ socket.on("rpc-registered", onRegistered);
174
+ for (const prefixedMethod of pending) socket.emit("rpc-register", { method: prefixedMethod });
175
+ maybeSettle();
176
+ }).catch((error) => {
177
+ this.sockets.delete(socket);
178
+ throw error;
179
+ });
180
+ }
181
+ onSocketDisconnect(socket) {
182
+ if (socket) this.sockets.delete(socket);
183
+ else this.sockets.clear();
184
+ }
185
+ /**
186
+ * Get the number of registered handlers
187
+ */
188
+ getHandlerCount() {
189
+ return this.handlers.size;
190
+ }
191
+ /**
192
+ * Check if a handler is registered
193
+ * @param method - The method name (without prefix)
194
+ */
195
+ hasHandler(method) {
196
+ const prefixedMethod = this.getPrefixedMethod(method);
197
+ return this.handlers.has(prefixedMethod);
198
+ }
199
+ /**
200
+ * Clear all handlers
201
+ */
202
+ clearHandlers() {
203
+ this.handlers.clear();
204
+ this.logger("Cleared all RPC handlers");
205
+ }
206
+ /**
207
+ * Get the prefixed method name
208
+ * @param method - The method name
209
+ */
210
+ getPrefixedMethod(method) {
211
+ return `${this.scopePrefix}:${method}`;
212
+ }
213
+ }
214
+
215
+ function describeSocketAckDrop(drop) {
216
+ switch (drop.reason) {
217
+ case "no-ack":
218
+ return "no ack callback on the frame (re-delivered after a transport close?); response dropped";
219
+ case "handler-threw":
220
+ return `handler threw: ${drop.error instanceof Error ? drop.error.message : String(drop.error)}`;
221
+ case "ack-threw":
222
+ return `ack callback threw: ${drop.error instanceof Error ? drop.error.message : String(drop.error)}`;
223
+ }
224
+ }
225
+ function safeAck(ack, onDrop) {
226
+ return (value) => {
227
+ if (typeof ack !== "function") {
228
+ onDrop({ reason: "no-ack" });
229
+ return;
230
+ }
231
+ try {
232
+ ack(value);
233
+ } catch (error) {
234
+ onDrop({ reason: "ack-threw", error });
235
+ }
236
+ };
237
+ }
238
+ async function answerSocketRequest(ack, run, onDrop) {
239
+ let value;
240
+ try {
241
+ value = await run();
242
+ } catch (error) {
243
+ onDrop({ reason: "handler-threw", error });
244
+ return;
245
+ }
246
+ safeAck(ack, onDrop)(value);
247
+ }
248
+
249
+ function hasNetworkConnectivity() {
250
+ const interfaces = os.networkInterfaces();
251
+ for (const name of Object.keys(interfaces)) {
252
+ for (const iface of interfaces[name] || []) {
253
+ if (!iface.internal && iface.family === "IPv4") return true;
254
+ }
255
+ }
256
+ return false;
257
+ }
258
+ function isLidClosed() {
259
+ if (process.platform !== "darwin") return false;
260
+ try {
261
+ const output = execSync("ioreg -r -k AppleClamshellState -d 4", {
262
+ timeout: 5e3,
263
+ encoding: "utf-8"
264
+ });
265
+ return output.includes('"AppleClamshellState" = Yes');
266
+ } catch {
267
+ return false;
268
+ }
269
+ }
270
+ function hasExternalDisplay() {
271
+ if (process.platform !== "darwin") return false;
272
+ try {
273
+ const output = execSync("system_profiler SPDisplaysDataType -json 2>/dev/null", {
274
+ timeout: 1e4,
275
+ encoding: "utf-8"
276
+ });
277
+ const data = JSON.parse(output);
278
+ const gpus = data.SPDisplaysDataType || [];
279
+ for (const gpu of gpus) {
280
+ const displays = gpu.spdisplays_ndrvs || [];
281
+ for (const display of displays) {
282
+ const isBuiltIn = display.spdisplays_builtin === "spdisplays_yes" || display.spdisplays_connection_type === "spdisplays_internal";
283
+ if (!isBuiltIn) return true;
284
+ }
285
+ }
286
+ return false;
287
+ } catch {
288
+ return false;
289
+ }
290
+ }
291
+ function shouldReconnect() {
292
+ if (!hasNetworkConnectivity()) return false;
293
+ if (isLidClosed() && !hasExternalDisplay()) return false;
294
+ return true;
295
+ }
296
+
297
+ export { RpcHandlerManager as R, answerSocketRequest as a, shouldReconnect as b, describeSocketAckDrop as d, isRateQuotaCode as i, pauseForRateQuota as p, safeAck as s };