very-happy-cli 0.2.159 → 0.2.160

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 (258) hide show
  1. package/dist/{AcpBackend-DUYFlyfN.cjs → AcpBackend-Bm2rdke8.cjs} +78 -76
  2. package/dist/{AcpBackend-VsfkZiVF.mjs → AcpBackend-mzv8Dhba.mjs} +4 -2
  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-CFHAxumV.cjs +157 -0
  6. package/dist/BasePermissionHandler-m3WVholL.mjs +155 -0
  7. package/dist/BaseReasoningProcessor-BFa9_rZA.cjs +200 -0
  8. package/dist/BaseReasoningProcessor-CYrKBXGm.mjs +198 -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-CHh4lmjM.cjs → agentHome-CboCeKWq.cjs} +14 -28
  16. package/dist/{agentHome-CvsJyeQB.mjs → agentHome-Dj1C43aJ.mjs} +8 -22
  17. package/dist/api-CLMUr-SX.mjs +3339 -0
  18. package/dist/api-CgundNNX.cjs +3346 -0
  19. package/dist/{types-Dh-s4Lqs.mjs → apiMachine-B9dLW_p5.mjs} +9116 -16205
  20. package/dist/{types-BbvK1Tr_.cjs → apiMachine-Bn8482VM.cjs} +9104 -16247
  21. package/dist/assistantTools-BTqPnlFl.cjs +380 -0
  22. package/dist/assistantTools-D6tuc6o4.mjs +376 -0
  23. package/dist/attachmentContent-DpiTJZb4.cjs +88 -0
  24. package/dist/attachmentContent-_kxRznNf.mjs +82 -0
  25. package/dist/attachmentLimits-CzVrqgLR.cjs +354 -0
  26. package/dist/attachmentLimits-yba1uHFO.mjs +348 -0
  27. package/dist/auth-BDOVh5h5.cjs +220 -0
  28. package/dist/auth-Cwutmdsa.mjs +225 -0
  29. package/dist/auth-PYHZQNPp.mjs +218 -0
  30. package/dist/auth-ba4WMYrN.cjs +227 -0
  31. package/dist/authRelay-BdYkC1Po.cjs +156 -0
  32. package/dist/authRelay-DSAvg1uv.mjs +143 -0
  33. package/dist/{auto-DKmEls8Z.cjs → auto-BOX_fgmR.cjs} +70 -79
  34. package/dist/{auto-nb8GhRRy.mjs → auto-BXu14yP_.mjs} +27 -36
  35. package/dist/backgroundTaskActivity-8PdPxrvy.mjs +149 -0
  36. package/dist/backgroundTaskActivity-CBvUdj39.cjs +157 -0
  37. package/dist/bootstrap-B5G1TijC.cjs +116 -0
  38. package/dist/bootstrap-hxXPCFMx.mjs +112 -0
  39. package/dist/browser-Y6Bl8L_O.cjs +22 -0
  40. package/dist/browser-jh2P0UVZ.mjs +20 -0
  41. package/dist/claudeCliPath-BqkaH2oR.mjs +8 -0
  42. package/dist/claudeCliPath-U4HHmV4r.cjs +10 -0
  43. package/dist/claudeLocal-BaY4fZKi.mjs +339 -0
  44. package/dist/claudeLocal-CRGG4Pea.cjs +343 -0
  45. package/dist/claudeLocalLauncher-D4T7MTqd.mjs +152 -0
  46. package/dist/claudeLocalLauncher-DyEbVzUN.cjs +154 -0
  47. package/dist/cliUpdate-DsKXPFYp.cjs +120 -0
  48. package/dist/cliUpdate-Y34VGe9Y.mjs +112 -0
  49. package/dist/client-3Ac-O4pw.cjs +104 -0
  50. package/dist/client-BPNbmtvO.cjs +119 -0
  51. package/dist/client-CeGKqqcJ.mjs +100 -0
  52. package/dist/client-ClR0K8zX.mjs +112 -0
  53. package/dist/codex/happyMcpStdioBridge.cjs +33 -14
  54. package/dist/codex/happyMcpStdioBridge.mjs +26 -7
  55. package/dist/codexAppServerClient-I3teiV-N.mjs +1088 -0
  56. package/dist/codexAppServerClient-q2FjnRcK.cjs +1090 -0
  57. package/dist/codexCommand-4zcccIoq.cjs +2088 -0
  58. package/dist/codexCommand-Cc9gcbdX.mjs +2086 -0
  59. package/dist/codexThreadFork-BH9IZPqD.cjs +350 -0
  60. package/dist/codexThreadFork-slzAseLx.mjs +338 -0
  61. package/dist/{config-ClLtM6F3.mjs → config-CTx_jb-C.mjs} +7 -40
  62. package/dist/{config-DLx-vW3I.cjs → config-Ci9Kpgwa.cjs} +26 -59
  63. package/dist/configuration-BSYpcPwE.cjs +181 -0
  64. package/dist/configuration-RfeNjFmd.mjs +170 -0
  65. package/dist/connect-BpOdzNbE.mjs +682 -0
  66. package/dist/connect-C2CiOUFs.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-DsDr6E2t.cjs +69 -0
  72. package/dist/context-H0Bcb9S_.mjs +65 -0
  73. package/dist/controlClient-BGbDcgWS.mjs +260 -0
  74. package/dist/controlClient-Bcwv3D21.cjs +279 -0
  75. package/dist/createSessionMetadata-BJxEnM-o.cjs +58 -0
  76. package/dist/createSessionMetadata-CVVkGjxV.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-C5CYTVpm.cjs +507 -0
  82. package/dist/deterministicJson-CzkFJWw1.mjs +502 -0
  83. package/dist/doctor-BPkYWSuq.mjs +75 -0
  84. package/dist/doctor-D2YJ-Yn2.cjs +395 -0
  85. package/dist/doctor-DOvByjbk.mjs +391 -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-BCwNrMyv.cjs +64 -0
  92. package/dist/ensureDaemonRunning-Dqa2pOjY.mjs +61 -0
  93. package/dist/handleResumeCommand-BvXYf5El.mjs +240 -0
  94. package/dist/handleResumeCommand-C2cKchpX.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-BEOMECtE.cjs → index-B6pAdvJx.cjs} +121 -91
  99. package/dist/index-Bu5Zi_a9.cjs +182 -0
  100. package/dist/index-D3kI0hDR.cjs +107 -0
  101. package/dist/index-DA7yINuk.cjs +994 -0
  102. package/dist/index-DDeHXrIX.cjs +71 -0
  103. package/dist/index-DKLU_fD0.mjs +158 -0
  104. package/dist/{index-2mCaeKyf.mjs → index-DMZqWwsP.mjs} +68 -38
  105. package/dist/index-DVkMGPyS.mjs +68 -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-BgoC2e_2.cjs +88 -0
  111. package/dist/install-CFY3tYtJ.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-BeDfxxEX.cjs +305 -0
  122. package/dist/lidState-CeEt442o.mjs +297 -0
  123. package/dist/limits-C-a7gr04.cjs +43 -0
  124. package/dist/limits-DIo7rEBR.mjs +36 -0
  125. package/dist/localHappyAgentAuth-C-HQyiv6.mjs +82 -0
  126. package/dist/localHappyAgentAuth-D6rFhaoc.cjs +86 -0
  127. package/dist/logger-6HYUEXNk.mjs +271 -0
  128. package/dist/logger-CS0mw3fa.cjs +275 -0
  129. package/dist/loginShellEnv-BkuYtExZ.cjs +182 -0
  130. package/dist/loginShellEnv-Dw8M7tkI.mjs +167 -0
  131. package/dist/machineMetadata-DyDbODYd.cjs +41 -0
  132. package/dist/machineMetadata-oOzBfDfs.mjs +38 -0
  133. package/dist/main-BkxJP6JQ.cjs +941 -0
  134. package/dist/main-BwNIAI1A.mjs +939 -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-B1A4I3TK.mjs} +27 -33
  138. package/dist/{mcp-CPYbtsYG.cjs → mcp-Hszd7qpS.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-BhaKlnxz.mjs +171 -0
  146. package/dist/package-BwMrPwqH.cjs +173 -0
  147. package/dist/path-B7zW-WwE.cjs +18 -0
  148. package/dist/path-D2wdaNSk.mjs +15 -0
  149. package/dist/peerTools-BTqw97Gb.mjs +272 -0
  150. package/dist/peerTools-BvKtHXj8.cjs +283 -0
  151. package/dist/permissionMode-Cr5JCbB7.mjs +80 -0
  152. package/dist/permissionMode-CrV-XuMs.cjs +87 -0
  153. package/dist/persistence-HGW_ZVs9.mjs +372 -0
  154. package/dist/persistence-yKTH3-5X.cjs +414 -0
  155. package/dist/piExtension.mjs +2 -1
  156. package/dist/piRunnerArgs-BNloJCCg.cjs +66 -0
  157. package/dist/piRunnerArgs-BuX1UFWy.mjs +59 -0
  158. package/dist/{piRuntime-kLZNpAAl.mjs → piRuntime-CSGkwCKQ.mjs} +2 -2
  159. package/dist/{piRuntime-NtF0YqjH.cjs → piRuntime-C_H7MJCM.cjs} +4 -4
  160. package/dist/{piTerminal-B0fEOV_2.mjs → piTerminal-C8a1OrNQ.mjs} +32 -35
  161. package/dist/{piTerminal-9J0GAKzb.cjs → piTerminal-DNCZ6yTM.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-Ccvsz7Ou.mjs +536 -0
  167. package/dist/registerCommonHandlers-DskirN-_.cjs +538 -0
  168. package/dist/registerKillSessionHandler-DZeLXWcB.cjs +361 -0
  169. package/dist/registerKillSessionHandler-GYvHdipX.mjs +358 -0
  170. package/dist/remoteSessionClient-B0LraSB9.cjs +634 -0
  171. package/dist/remoteSessionClient-CYnXRynE.mjs +612 -0
  172. package/dist/resources-BdFBQi8r.mjs +117 -0
  173. package/dist/resources-JDPugcDq.cjs +120 -0
  174. package/dist/run-CJzxoHVh.cjs +5762 -0
  175. package/dist/run-D3ifupU3.mjs +5739 -0
  176. package/dist/runClaude-Ba01qT-u.mjs +848 -0
  177. package/dist/runClaude-Da3RirzE.cjs +850 -0
  178. package/dist/runClaudeDeps-DOt79DjU.mjs +3624 -0
  179. package/dist/runClaudeDeps-DOzEBMls.cjs +3649 -0
  180. package/dist/{runGemini-DV6Ouadt.mjs → runGemini-BGeTz57m.mjs} +58 -31
  181. package/dist/{runGemini-F-mqx3_K.cjs → runGemini-DSr9LIxL.cjs} +202 -175
  182. package/dist/{runOpenClaw-Qqo9j63M.cjs → runOpenClaw-B1mTxN35.cjs} +64 -65
  183. package/dist/{runOpenClaw-D7MlPS5n.mjs → runOpenClaw-CogSedIc.mjs} +31 -32
  184. package/dist/sandbox-CG7IyDTU.cjs +187 -0
  185. package/dist/sandbox-DTe6d54R.mjs +180 -0
  186. package/dist/selfCheck-C9mVrQwf.mjs +84 -0
  187. package/dist/selfCheck-Dc-mNSLb.cjs +87 -0
  188. package/dist/{send-4qJTCAYW.cjs → send-B7J_eaG3.cjs} +16 -9
  189. package/dist/{send-CLhYXNgy.mjs → send-CBXJKc6O.mjs} +12 -5
  190. package/dist/server-CZTP_iOn.cjs +407 -0
  191. package/dist/server-DcVBv04l.mjs +404 -0
  192. package/dist/sessionLock-Bys1PNSo.cjs +205 -0
  193. package/dist/sessionLock-D-EG2CfG.mjs +197 -0
  194. package/dist/sessionModeFile-DMl3dw3r.mjs +32 -0
  195. package/dist/sessionModeFile-RSm0NQkH.cjs +36 -0
  196. package/dist/sessionOps-Dn8z85h_.cjs +783 -0
  197. package/dist/sessionOps-SuHW8Dfe.mjs +760 -0
  198. package/dist/sessionScanner-BOrGjMXL.cjs +209 -0
  199. package/dist/sessionScanner-CX3onqXh.mjs +206 -0
  200. package/dist/{sessions-CzIH2rGp.mjs → sessions-BEG_HTSi.mjs} +17 -8
  201. package/dist/{sessions-Bh1pyddi.cjs → sessions-D74aJbhL.cjs} +37 -28
  202. package/dist/setupOfflineReconnection-ByElY60m.cjs +74 -0
  203. package/dist/setupOfflineReconnection-DpvWTt69.mjs +72 -0
  204. package/dist/smallFastModel-BLNgMrwR.mjs +18 -0
  205. package/dist/smallFastModel-D_uxGMo3.cjs +21 -0
  206. package/dist/{spawn-CPIWlPOM.mjs → spawn-B7yro0b2.mjs} +26 -38
  207. package/dist/{spawn-CmFOSVdW.cjs → spawn-DgR0RKRs.cjs} +52 -64
  208. package/dist/spawnAgents-BGQiEF-w.cjs +52 -0
  209. package/dist/spawnAgents-DZzZ9jMI.mjs +45 -0
  210. package/dist/spawnHappyCLI-B2H5s4B_.mjs +64 -0
  211. package/dist/spawnHappyCLI-DBhwZT7O.cjs +66 -0
  212. package/dist/specialCommands-BSqhYg5X.mjs +52 -0
  213. package/dist/specialCommands-DSsTeRej.cjs +54 -0
  214. package/dist/startFileWatcher-B4VsLgjD.cjs +71 -0
  215. package/dist/startFileWatcher-DErVWZE4.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-C8gyQFMc.mjs +69 -0
  221. package/dist/sync-DccIKZ5_.cjs +71 -0
  222. package/dist/systemPrompt-BwTPWfMu.cjs +97 -0
  223. package/dist/systemPrompt-DX521JJz.mjs +94 -0
  224. package/dist/{teams-CEahj4cm.mjs → teams-C32F1hqd.mjs} +9 -40
  225. package/dist/{teams-CB1R9-Z9.cjs → teams-Dl8g8kTI.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-D0XyHOid.mjs +38 -0
  233. package/dist/time-DCuTyook.cjs +42 -0
  234. package/dist/titleGenerator-CQ8CoGhg.mjs +166 -0
  235. package/dist/titleGenerator-ChzMJsyg.cjs +172 -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-BvUOTa8G.cjs} +15 -12
  239. package/dist/{todo-Cknp5D4U.mjs → todo-CZ6cFrrn.mjs} +11 -8
  240. package/dist/tools-BZtHF_qQ.mjs +177 -0
  241. package/dist/tools-Be3AoAwu.cjs +63 -0
  242. package/dist/tools-DQj0AeLk.cjs +180 -0
  243. package/dist/tools-DkluDcG4.mjs +60 -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-BkLzaJ6I.mjs +47 -0
  249. package/dist/uninstall-x-TUtf5H.cjs +49 -0
  250. package/package.json +7 -7
  251. package/dist/agentGuidance-BRDN1NoZ.cjs +0 -2217
  252. package/dist/agentGuidance-KgvYuF3R.mjs +0 -2145
  253. package/dist/index-BF6WfgV5.mjs +0 -19624
  254. package/dist/index-C-JazrMB.mjs +0 -52
  255. package/dist/index-blDSadUR.cjs +0 -58
  256. package/dist/index-rH3DrQ5B.cjs +0 -19688
  257. package/dist/limits-BH5CV5vR.cjs +0 -2683
  258. package/dist/limits-CjRj8IX5.mjs +0 -2558
@@ -0,0 +1,119 @@
1
+ 'use strict';
2
+
3
+ var configuration = require('./configuration-BSYpcPwE.cjs');
4
+ var persistence = require('./persistence-yKTH3-5X.cjs');
5
+
6
+ class AutomationsRequestError extends Error {
7
+ constructor(status, code, runStatus) {
8
+ super(describeAutomationError(status, code, runStatus));
9
+ this.status = status;
10
+ this.code = code;
11
+ this.runStatus = runStatus;
12
+ }
13
+ }
14
+ function isAutomationsUnavailable(error) {
15
+ return error instanceof AutomationsRequestError && error.status === 404 && !error.code.endsWith("_not_found");
16
+ }
17
+ const AUTOMATIONS_UNAVAILABLE_MESSAGE = "Automations are not enabled on this server (set VH_AUTOMATIONS_ENABLED=true on the server, or upgrade it).";
18
+ function describeAutomationError(status, code, runStatus) {
19
+ if (status === 404 && !code.endsWith("_not_found")) return AUTOMATIONS_UNAVAILABLE_MESSAGE;
20
+ const known = {
21
+ automation_not_found: "No automation with that name or id.",
22
+ run_not_found: "No automation run with that id.",
23
+ machine_not_found: "That machine is not registered on this account.",
24
+ session_not_found: "That session does not belong to this account.",
25
+ automation_name_taken: "An automation with that name already exists.",
26
+ automation_count_quota_exceeded: "This account already holds the maximum number of automations (active + paused). Delete one you no longer need (`very-happy auto delete <name>`) before creating another.",
27
+ automation_paused: "That automation is paused; resume it before firing.",
28
+ stale_automation: "The automation changed since you read it; read it again and retry with the new version.",
29
+ run_finished: `The run already reached a terminal state${runStatus ? ` (${runStatus})` : ""}. In a continued (sticky) session, pass the runId named in the latest prompt header \u2014 the environment default is the run that started the session.`,
30
+ claim_mismatch: "Another daemon holds the claim for that run.",
31
+ run_not_claimed: "The run has not been claimed by its machine yet; cancel it instead of reporting.",
32
+ status_required: "An explicit report needs status done or failed.",
33
+ claim_required: "Lease, session and sticky fields are daemon-only; report just the outcome.",
34
+ sticky_requires_session: "A sticky key needs a session id.",
35
+ transaction_conflict: "The server was busy; retry the same request.",
36
+ invalid_cron: "The cron expression is invalid.",
37
+ invalid_timezone: "The time zone is not a valid IANA zone."
38
+ };
39
+ if (known[code]) return known[code];
40
+ if (status === 400) return "The server rejected the request (HTTP 400): check the arguments, or the server may expect a newer request shape.";
41
+ return `Automations request failed (HTTP ${status}${code ? `, ${code}` : ""}).`;
42
+ }
43
+ function createAutomationsClient(options) {
44
+ const doFetch = options.fetch ?? fetch;
45
+ const base = options.serverUrl.replace(/\/+$/, "");
46
+ async function request(method, path, body, query) {
47
+ const url = new URL(`${base}${path}`);
48
+ for (const [key, value] of Object.entries(query ?? {})) if (value !== void 0) url.searchParams.set(key, value);
49
+ let response;
50
+ try {
51
+ response = await doFetch(url.toString(), {
52
+ method,
53
+ redirect: "error",
54
+ headers: { "content-type": "application/json", authorization: `Bearer ${options.token}`, "x-happy-client": `${options.client ?? "cli-auto"}/${configuration.configuration.currentCliVersion}` },
55
+ body: body === void 0 ? void 0 : JSON.stringify(body),
56
+ signal: AbortSignal.timeout(options.timeoutMs ?? 25e3)
57
+ });
58
+ } catch {
59
+ throw new Error("Automations connection failed; the outcome may be unknown. Read the current state before retrying.");
60
+ }
61
+ let parsed = null;
62
+ try {
63
+ parsed = await response.json();
64
+ } catch {
65
+ parsed = null;
66
+ }
67
+ if (!response.ok) {
68
+ const code = typeof parsed?.error === "string" ? parsed.error : "";
69
+ throw new AutomationsRequestError(response.status, code, typeof parsed?.status === "string" ? parsed.status : void 0);
70
+ }
71
+ return parsed;
72
+ }
73
+ const enc = encodeURIComponent;
74
+ return {
75
+ list: (machineId) => request("GET", "/v1/automations", void 0, { machineId }).then((r) => r.automations),
76
+ get: (id) => request("GET", `/v1/automations/${enc(id)}`).then((r) => r.automation),
77
+ getByName: (name) => request("GET", `/v1/automations/by-name/${enc(name)}`).then((r) => r.automation),
78
+ create: (input) => request("POST", "/v1/automations", input).then((r) => r.automation),
79
+ update: (id, input) => request("PATCH", `/v1/automations/${enc(id)}`, input).then((r) => r.automation),
80
+ remove: (id) => request("DELETE", `/v1/automations/${enc(id)}`),
81
+ pause: (id) => request("POST", `/v1/automations/${enc(id)}/pause`).then((r) => r.automation),
82
+ resume: (id) => request("POST", `/v1/automations/${enc(id)}/resume`).then((r) => r.automation),
83
+ run: (id, input = {}) => request("POST", `/v1/automations/${enc(id)}/run`, input).then((r) => r.run),
84
+ fire: (name, input = {}) => request("POST", `/v1/automations/by-name/${enc(name)}/fire`, input),
85
+ runs: (query = {}) => request("GET", "/v1/automations/runs", void 0, {
86
+ automationId: query.automationId,
87
+ name: query.name,
88
+ status: query.status,
89
+ attention: query.attention ? "1" : void 0,
90
+ limit: query.limit === void 0 ? void 0 : String(query.limit)
91
+ }).then((r) => r.runs),
92
+ getRun: (id) => request("GET", `/v1/automations/runs/${enc(id)}`).then((r) => r.run),
93
+ cancel: (id) => request("POST", `/v1/automations/runs/${enc(id)}/cancel`).then((r) => r.run),
94
+ /** B-508: `by` records what resolved the flag (server default `owner`; older servers ignore the body). */
95
+ ack: (id, by) => request("POST", `/v1/automations/runs/${enc(id)}/ack`, by === void 0 ? void 0 : { by }).then((r) => r.run),
96
+ report: (id, input) => request("POST", `/v1/automations/runs/${enc(id)}/report`, input).then((r) => r.run),
97
+ claim: (input) => request("POST", "/v1/automations/claim", input),
98
+ stickies: (id, key) => request("GET", `/v1/automations/${enc(id)}/stickies`, void 0, { key }).then((r) => r.stickies),
99
+ putSticky: (id, key, sessionId) => request("PUT", `/v1/automations/${enc(id)}/stickies`, { key, sessionId }).then((r) => r.sticky),
100
+ deleteSticky: (id, key) => request("DELETE", `/v1/automations/${enc(id)}/stickies`, { key }).then((r) => r.removed)
101
+ };
102
+ }
103
+ async function authenticatedAutomationsClient(client = "cli-auto") {
104
+ const credentials = await persistence.readCredentialsForConfiguredRelay();
105
+ if (!credentials) throw new Error("Not authenticated. Run `very-happy auth login` first.");
106
+ const settings = await persistence.readSettings();
107
+ return { client: createAutomationsClient({ serverUrl: configuration.configuration.serverUrl, token: credentials.token, client }), machineId: settings.machineId };
108
+ }
109
+ function automationRunIdFromEnv(env = process.env) {
110
+ const value = env.VH_AUTOMATION_RUN_ID;
111
+ return value && /^[a-zA-Z0-9_-]{1,128}$/.test(value) ? value : void 0;
112
+ }
113
+
114
+ exports.AUTOMATIONS_UNAVAILABLE_MESSAGE = AUTOMATIONS_UNAVAILABLE_MESSAGE;
115
+ exports.AutomationsRequestError = AutomationsRequestError;
116
+ exports.authenticatedAutomationsClient = authenticatedAutomationsClient;
117
+ exports.automationRunIdFromEnv = automationRunIdFromEnv;
118
+ exports.createAutomationsClient = createAutomationsClient;
119
+ exports.isAutomationsUnavailable = isAutomationsUnavailable;
@@ -0,0 +1,100 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { c as configuration } from './configuration-RfeNjFmd.mjs';
3
+ import { readSettings, readPersistedSessions, readCredentialsForConfiguredRelay } from './persistence-HGW_ZVs9.mjs';
4
+ import { r as readTeamScope, t as teamScopePath, w as writeTeamScope } from './context-H0Bcb9S_.mjs';
5
+
6
+ async function teamRequest(path, method, token, scoped, body) {
7
+ const response = await fetch(`${configuration.serverUrl}${path}`, {
8
+ method,
9
+ redirect: "error",
10
+ headers: { "content-type": "application/json", ...scoped ? { "x-happy-team-token": token } : { authorization: `Bearer ${token}` } },
11
+ body: body === void 0 ? void 0 : JSON.stringify(body),
12
+ signal: AbortSignal.timeout(25e3)
13
+ }).catch(() => {
14
+ throw new Error("Teams connection failed; outcome may be unknown. Reuse the request ID when retrying.");
15
+ });
16
+ if (!response.ok) throw new Error(`Teams request failed (HTTP ${response.status})`);
17
+ try {
18
+ return await response.json();
19
+ } catch {
20
+ throw new Error("Teams returned an invalid response");
21
+ }
22
+ }
23
+ class TeamConnectionPreflightError extends Error {
24
+ }
25
+ const initializationLocks = /* @__PURE__ */ new Map();
26
+ async function serializeInitialization(path, work) {
27
+ const previous = initializationLocks.get(path) ?? Promise.resolve();
28
+ const next = previous.catch(() => {
29
+ }).then(work);
30
+ initializationLocks.set(path, next);
31
+ try {
32
+ return await next;
33
+ } finally {
34
+ if (initializationLocks.get(path) === next) initializationLocks.delete(path);
35
+ }
36
+ }
37
+ function createTeamsClient(sessionId) {
38
+ const scopePath = () => teamScopePath(sessionId ?? process.env.HAPPY_SESSION_ID);
39
+ return {
40
+ async initialize(input, options) {
41
+ const path = scopePath();
42
+ return serializeInitialization(path, async () => {
43
+ const priorScope = await readTeamScope(path);
44
+ if (priorScope && !options?.resumeAdoption) throw new Error("This session already has a team scope; use scoped team tools");
45
+ if (process.env.VH_TEAM_SCOPE_FILE) throw new Error("Assigned team scope is missing or already managed; ask the owner to restore it");
46
+ const sid = sessionId ?? process.env.HAPPY_SESSION_ID;
47
+ if (!sid) throw new Error("A managed session identity is required");
48
+ const machineId = (await readSettings()).machineId;
49
+ if (!machineId) throw new TeamConnectionPreflightError("Connect this machine to Very Happy before joining a team");
50
+ if (input.machineId && input.machineId !== machineId) throw new TeamConnectionPreflightError("Teams must use this session\u2019s local machine");
51
+ const persisted = readPersistedSessions()[sid];
52
+ if (!persisted || persisted.metadata.machineId !== machineId) throw new TeamConnectionPreflightError("Team identity must be a persisted session on this machine");
53
+ const credentials = await readCredentialsForConfiguredRelay();
54
+ if (!credentials) throw new TeamConnectionPreflightError("Sign in to Very Happy before creating or joining a team");
55
+ if (priorScope && !options?.expectedTeamId) throw new Error("This session already belongs to another team scope");
56
+ let teamId = input.teamId ?? options?.expectedTeamId;
57
+ if (!teamId) {
58
+ const created = await teamRequest("/v1/teams", "POST", credentials.token, false, { name: input.name, machineId, requestId: input.requestId });
59
+ teamId = created.team.id;
60
+ } else {
61
+ const existing = await teamRequest(`/v1/teams/${encodeURIComponent(teamId)}`, "GET", credentials.token, false);
62
+ if (existing.team?.machineId !== machineId) throw new TeamConnectionPreflightError("Team belongs to another machine");
63
+ }
64
+ if (options?.onTeamResolved) await options.onTeamResolved(teamId);
65
+ if (priorScope) {
66
+ if (priorScope.teamId !== teamId || priorScope.taskId) throw new Error("This session already belongs to another team scope");
67
+ const inspected = await teamRequest(`/v1/teams/${encodeURIComponent(teamId)}/agent`, "GET", priorScope.scopeToken, true);
68
+ const bot = inspected.team?.bots?.find((candidate) => candidate.id === priorScope.botId);
69
+ if (!bot?.root || bot.managed || bot.sessionId !== sid) throw new Error("Existing scope is not this session\u2019s root identity");
70
+ return { team: inspected.team, botId: priorScope.botId };
71
+ }
72
+ const result = await teamRequest(
73
+ `/v1/teams/${encodeURIComponent(teamId)}/actions`,
74
+ "POST",
75
+ credentials.token,
76
+ false,
77
+ { requestId: input.requestId, action: { type: "join", name: input.name, sessionId: sid, ...input.botId ? { botId: input.botId } : {} } }
78
+ );
79
+ if (!result.credential?.token || !result.credential?.botId) throw new Error("Team join did not issue a credential");
80
+ await writeTeamScope(path, { serverUrl: configuration.serverUrl, teamId, botId: result.credential.botId, scopeToken: result.credential.token });
81
+ return { team: result.team, botId: result.credential.botId };
82
+ });
83
+ },
84
+ async inspect() {
85
+ const scope = await readTeamScope(scopePath());
86
+ if (!scope) throw new Error("Join or create a team first");
87
+ const { credential: _credential, ...safe } = await teamRequest(`/v1/teams/${encodeURIComponent(scope.teamId)}/agent`, "GET", scope.scopeToken, true);
88
+ return safe;
89
+ },
90
+ async action(action, requestId = randomUUID()) {
91
+ const scope = await readTeamScope(scopePath());
92
+ if (!scope) throw new Error("Join or create a team first");
93
+ const result = await teamRequest(`/v1/teams/${encodeURIComponent(scope.teamId)}/agent`, "POST", scope.scopeToken, true, { requestId, action });
94
+ const { credential: _credential, ...safe } = result;
95
+ return safe;
96
+ }
97
+ };
98
+ }
99
+
100
+ export { TeamConnectionPreflightError as T, createTeamsClient as c, teamRequest as t };
@@ -0,0 +1,112 @@
1
+ import { c as configuration } from './configuration-RfeNjFmd.mjs';
2
+ import { readCredentialsForConfiguredRelay, readSettings } from './persistence-HGW_ZVs9.mjs';
3
+
4
+ class AutomationsRequestError extends Error {
5
+ constructor(status, code, runStatus) {
6
+ super(describeAutomationError(status, code, runStatus));
7
+ this.status = status;
8
+ this.code = code;
9
+ this.runStatus = runStatus;
10
+ }
11
+ }
12
+ function isAutomationsUnavailable(error) {
13
+ return error instanceof AutomationsRequestError && error.status === 404 && !error.code.endsWith("_not_found");
14
+ }
15
+ const AUTOMATIONS_UNAVAILABLE_MESSAGE = "Automations are not enabled on this server (set VH_AUTOMATIONS_ENABLED=true on the server, or upgrade it).";
16
+ function describeAutomationError(status, code, runStatus) {
17
+ if (status === 404 && !code.endsWith("_not_found")) return AUTOMATIONS_UNAVAILABLE_MESSAGE;
18
+ const known = {
19
+ automation_not_found: "No automation with that name or id.",
20
+ run_not_found: "No automation run with that id.",
21
+ machine_not_found: "That machine is not registered on this account.",
22
+ session_not_found: "That session does not belong to this account.",
23
+ automation_name_taken: "An automation with that name already exists.",
24
+ automation_count_quota_exceeded: "This account already holds the maximum number of automations (active + paused). Delete one you no longer need (`very-happy auto delete <name>`) before creating another.",
25
+ automation_paused: "That automation is paused; resume it before firing.",
26
+ stale_automation: "The automation changed since you read it; read it again and retry with the new version.",
27
+ run_finished: `The run already reached a terminal state${runStatus ? ` (${runStatus})` : ""}. In a continued (sticky) session, pass the runId named in the latest prompt header \u2014 the environment default is the run that started the session.`,
28
+ claim_mismatch: "Another daemon holds the claim for that run.",
29
+ run_not_claimed: "The run has not been claimed by its machine yet; cancel it instead of reporting.",
30
+ status_required: "An explicit report needs status done or failed.",
31
+ claim_required: "Lease, session and sticky fields are daemon-only; report just the outcome.",
32
+ sticky_requires_session: "A sticky key needs a session id.",
33
+ transaction_conflict: "The server was busy; retry the same request.",
34
+ invalid_cron: "The cron expression is invalid.",
35
+ invalid_timezone: "The time zone is not a valid IANA zone."
36
+ };
37
+ if (known[code]) return known[code];
38
+ if (status === 400) return "The server rejected the request (HTTP 400): check the arguments, or the server may expect a newer request shape.";
39
+ return `Automations request failed (HTTP ${status}${code ? `, ${code}` : ""}).`;
40
+ }
41
+ function createAutomationsClient(options) {
42
+ const doFetch = options.fetch ?? fetch;
43
+ const base = options.serverUrl.replace(/\/+$/, "");
44
+ async function request(method, path, body, query) {
45
+ const url = new URL(`${base}${path}`);
46
+ for (const [key, value] of Object.entries(query ?? {})) if (value !== void 0) url.searchParams.set(key, value);
47
+ let response;
48
+ try {
49
+ response = await doFetch(url.toString(), {
50
+ method,
51
+ redirect: "error",
52
+ headers: { "content-type": "application/json", authorization: `Bearer ${options.token}`, "x-happy-client": `${options.client ?? "cli-auto"}/${configuration.currentCliVersion}` },
53
+ body: body === void 0 ? void 0 : JSON.stringify(body),
54
+ signal: AbortSignal.timeout(options.timeoutMs ?? 25e3)
55
+ });
56
+ } catch {
57
+ throw new Error("Automations connection failed; the outcome may be unknown. Read the current state before retrying.");
58
+ }
59
+ let parsed = null;
60
+ try {
61
+ parsed = await response.json();
62
+ } catch {
63
+ parsed = null;
64
+ }
65
+ if (!response.ok) {
66
+ const code = typeof parsed?.error === "string" ? parsed.error : "";
67
+ throw new AutomationsRequestError(response.status, code, typeof parsed?.status === "string" ? parsed.status : void 0);
68
+ }
69
+ return parsed;
70
+ }
71
+ const enc = encodeURIComponent;
72
+ return {
73
+ list: (machineId) => request("GET", "/v1/automations", void 0, { machineId }).then((r) => r.automations),
74
+ get: (id) => request("GET", `/v1/automations/${enc(id)}`).then((r) => r.automation),
75
+ getByName: (name) => request("GET", `/v1/automations/by-name/${enc(name)}`).then((r) => r.automation),
76
+ create: (input) => request("POST", "/v1/automations", input).then((r) => r.automation),
77
+ update: (id, input) => request("PATCH", `/v1/automations/${enc(id)}`, input).then((r) => r.automation),
78
+ remove: (id) => request("DELETE", `/v1/automations/${enc(id)}`),
79
+ pause: (id) => request("POST", `/v1/automations/${enc(id)}/pause`).then((r) => r.automation),
80
+ resume: (id) => request("POST", `/v1/automations/${enc(id)}/resume`).then((r) => r.automation),
81
+ run: (id, input = {}) => request("POST", `/v1/automations/${enc(id)}/run`, input).then((r) => r.run),
82
+ fire: (name, input = {}) => request("POST", `/v1/automations/by-name/${enc(name)}/fire`, input),
83
+ runs: (query = {}) => request("GET", "/v1/automations/runs", void 0, {
84
+ automationId: query.automationId,
85
+ name: query.name,
86
+ status: query.status,
87
+ attention: query.attention ? "1" : void 0,
88
+ limit: query.limit === void 0 ? void 0 : String(query.limit)
89
+ }).then((r) => r.runs),
90
+ getRun: (id) => request("GET", `/v1/automations/runs/${enc(id)}`).then((r) => r.run),
91
+ cancel: (id) => request("POST", `/v1/automations/runs/${enc(id)}/cancel`).then((r) => r.run),
92
+ /** B-508: `by` records what resolved the flag (server default `owner`; older servers ignore the body). */
93
+ ack: (id, by) => request("POST", `/v1/automations/runs/${enc(id)}/ack`, by === void 0 ? void 0 : { by }).then((r) => r.run),
94
+ report: (id, input) => request("POST", `/v1/automations/runs/${enc(id)}/report`, input).then((r) => r.run),
95
+ claim: (input) => request("POST", "/v1/automations/claim", input),
96
+ stickies: (id, key) => request("GET", `/v1/automations/${enc(id)}/stickies`, void 0, { key }).then((r) => r.stickies),
97
+ putSticky: (id, key, sessionId) => request("PUT", `/v1/automations/${enc(id)}/stickies`, { key, sessionId }).then((r) => r.sticky),
98
+ deleteSticky: (id, key) => request("DELETE", `/v1/automations/${enc(id)}/stickies`, { key }).then((r) => r.removed)
99
+ };
100
+ }
101
+ async function authenticatedAutomationsClient(client = "cli-auto") {
102
+ const credentials = await readCredentialsForConfiguredRelay();
103
+ if (!credentials) throw new Error("Not authenticated. Run `very-happy auth login` first.");
104
+ const settings = await readSettings();
105
+ return { client: createAutomationsClient({ serverUrl: configuration.serverUrl, token: credentials.token, client }), machineId: settings.machineId };
106
+ }
107
+ function automationRunIdFromEnv(env = process.env) {
108
+ const value = env.VH_AUTOMATION_RUN_ID;
109
+ return value && /^[a-zA-Z0-9_-]{1,128}$/.test(value) ? value : void 0;
110
+ }
111
+
112
+ export { AUTOMATIONS_UNAVAILABLE_MESSAGE as A, authenticatedAutomationsClient as a, automationRunIdFromEnv as b, createAutomationsClient as c, AutomationsRequestError as d, isAutomationsUnavailable as i };
@@ -1,23 +1,42 @@
1
1
  'use strict';
2
2
 
3
- var agentGuidance = require('../agentGuidance-BRDN1NoZ.cjs');
3
+ var tools = require('../tools-Be3AoAwu.cjs');
4
+ var tools$1 = require('../tools-DQj0AeLk.cjs');
5
+ var peerTools = require('../peerTools-BvKtHXj8.cjs');
4
6
  var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
5
7
  var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
6
8
  var index_js = require('@modelcontextprotocol/sdk/client/index.js');
7
9
  var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
8
10
  var z = require('zod');
9
- var persistence = require('../limits-BH5CV5vR.cjs');
11
+ var limits = require('../limits-C-a7gr04.cjs');
12
+ var agentGuidance = require('../agentGuidance-B5NATuFa.cjs');
13
+ require('../client-3Ac-O4pw.cjs');
10
14
  require('node:crypto');
11
- require('node:fs/promises');
15
+ require('../configuration-BSYpcPwE.cjs');
12
16
  require('node:fs');
13
- require('node:path');
14
17
  require('node:os');
15
- require('axios');
16
- require('socket.io-client');
17
- require('@paralleldrive/cuid2');
18
+ require('node:path');
19
+ require('../package-BwMrPwqH.cjs');
20
+ require('node:fs/promises');
21
+ require('../persistence-yKTH3-5X.cjs');
22
+ require('../authRelay-BdYkC1Po.cjs');
18
23
  require('tweetnacl');
24
+ require('../logger-CS0mw3fa.cjs');
19
25
  require('chalk');
20
26
  require('node:util');
27
+ require('../context-DsDr6E2t.cjs');
28
+ require('../index-DA7yINuk.cjs');
29
+ require('@paralleldrive/cuid2');
30
+ require('../client-BPNbmtvO.cjs');
31
+ require('../ids-B6ZC0HGt.cjs');
32
+ require('../controlClient-Bcwv3D21.cjs');
33
+ require('../sessionOps-Dn8z85h_.cjs');
34
+ require('axios');
35
+ require('../time-DCuTyook.cjs');
36
+ require('socket.io-client');
37
+ require('../backgroundTaskActivity-CBvUdj39.cjs');
38
+ require('../remoteSessionClient-B0LraSB9.cjs');
39
+ require('../trimIdent-4gvk9Wk6.cjs');
21
40
 
22
41
  function parseArgs(argv) {
23
42
  let url = null;
@@ -105,10 +124,10 @@ async function main() {
105
124
  }
106
125
  );
107
126
  server.registerTool(
108
- persistence.CLIPBOARD_TOOL_NAME,
127
+ limits.CLIPBOARD_TOOL_NAME,
109
128
  {
110
- description: persistence.CLIPBOARD_TOOL_DESCRIPTION,
111
- title: persistence.CLIPBOARD_TOOL_TITLE,
129
+ description: limits.CLIPBOARD_TOOL_DESCRIPTION,
130
+ title: limits.CLIPBOARD_TOOL_TITLE,
112
131
  inputSchema: {
113
132
  text: z.z.string().describe("The text to copy to the user's clipboard")
114
133
  }
@@ -116,7 +135,7 @@ async function main() {
116
135
  async (args) => {
117
136
  try {
118
137
  const client = await ensureHttpClient();
119
- const response = await client.callTool({ name: persistence.CLIPBOARD_TOOL_NAME, arguments: args });
138
+ const response = await client.callTool({ name: limits.CLIPBOARD_TOOL_NAME, arguments: args });
120
139
  return response;
121
140
  } catch (error) {
122
141
  return {
@@ -135,7 +154,7 @@ async function main() {
135
154
  if (response.isError) throw new Error(text || "Teams operation failed");
136
155
  return JSON.parse(text);
137
156
  };
138
- agentGuidance.registerTeamsTools(server, void 0, {
157
+ tools.registerTeamsTools(server, void 0, {
139
158
  initialize: (input) => forwardTeam(input.teamId ? "team_join" : "team_create", input),
140
159
  inspect: () => forwardTeam("team_inspect", {}),
141
160
  action: (action, requestId) => {
@@ -143,8 +162,8 @@ async function main() {
143
162
  return forwardTeam(`team_${String(type).replaceAll("-", "_")}`, { ...args, requestId });
144
163
  }
145
164
  });
146
- agentGuidance.registerAutomationTools(server, (name, args) => forwardTeam(name, args));
147
- agentGuidance.registerSessionPeerTools(server, (name, args) => forwardTeam(name, args));
165
+ tools$1.registerAutomationTools(server, (name, args) => forwardTeam(name, args));
166
+ peerTools.registerSessionPeerTools(server, (name, args) => forwardTeam(name, args));
148
167
  const stdio = new stdio_js.StdioServerTransport();
149
168
  await server.connect(stdio);
150
169
  }
@@ -1,21 +1,40 @@
1
- import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools, c as registerAutomationTools, d as registerSessionPeerTools } from '../agentGuidance-KgvYuF3R.mjs';
1
+ import { r as registerTeamsTools } from '../tools-DkluDcG4.mjs';
2
+ import { r as registerAutomationTools } from '../tools-BZtHF_qQ.mjs';
3
+ import { r as registerSessionPeerTools } from '../peerTools-BTqw97Gb.mjs';
2
4
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
5
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
6
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
7
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
8
  import { z } from 'zod';
7
- import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-CjRj8IX5.mjs';
9
+ import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-DIo7rEBR.mjs';
10
+ import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION } from '../agentGuidance-CQuNlNx8.mjs';
11
+ import '../client-CeGKqqcJ.mjs';
8
12
  import 'node:crypto';
9
- import 'node:fs/promises';
13
+ import '../configuration-RfeNjFmd.mjs';
10
14
  import 'node:fs';
11
- import 'node:path';
12
15
  import 'node:os';
13
- import 'axios';
14
- import 'socket.io-client';
15
- import '@paralleldrive/cuid2';
16
+ import 'node:path';
17
+ import '../package-BhaKlnxz.mjs';
18
+ import 'node:fs/promises';
19
+ import '../persistence-HGW_ZVs9.mjs';
20
+ import '../authRelay-DSAvg1uv.mjs';
16
21
  import 'tweetnacl';
22
+ import '../logger-6HYUEXNk.mjs';
17
23
  import 'chalk';
18
24
  import 'node:util';
25
+ import '../context-H0Bcb9S_.mjs';
26
+ import '../index-qdS1friN.mjs';
27
+ import '@paralleldrive/cuid2';
28
+ import '../client-ClR0K8zX.mjs';
29
+ import '../ids-DU6sLx4C.mjs';
30
+ import '../controlClient-BGbDcgWS.mjs';
31
+ import '../sessionOps-SuHW8Dfe.mjs';
32
+ import 'axios';
33
+ import '../time-D0XyHOid.mjs';
34
+ import 'socket.io-client';
35
+ import '../backgroundTaskActivity-8PdPxrvy.mjs';
36
+ import '../remoteSessionClient-CYnXRynE.mjs';
37
+ import '../trimIdent-BAjmv_TG.mjs';
19
38
 
20
39
  function parseArgs(argv) {
21
40
  let url = null;