very-happy-cli 0.2.178 → 0.2.180
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AcpBackend-DCQXHRzT.mjs → AcpBackend-B8Zi30Zh.mjs} +135 -16
- package/dist/{AcpBackend-CDkAQXYf.cjs → AcpBackend-DfRDtMcG.cjs} +135 -16
- package/dist/{AcpSessionManager-DckmUZza.cjs → AcpSessionManager-CASKOnOj.cjs} +38 -4
- package/dist/{AcpSessionManager-BXrQcqwC.mjs → AcpSessionManager-i8Rab0xT.mjs} +38 -4
- package/dist/{BasePermissionHandler-BVlrEhIi.mjs → BasePermissionHandler-26fKbRCm.mjs} +5 -2
- package/dist/{BasePermissionHandler-DyLmKKtO.cjs → BasePermissionHandler-BlM_tfej.cjs} +5 -2
- package/dist/acpSessionResume-B9l54P-X.mjs +67 -0
- package/dist/acpSessionResume-CR5pmgVo.cjs +74 -0
- package/dist/{agentHome-CEp9RMyK.cjs → agentHome-C7Sb7-Tz.cjs} +4 -4
- package/dist/{agentHome-C1xi37as.mjs → agentHome-CmGy0NWv.mjs} +4 -4
- package/dist/{api-JANhFdZV.cjs → api-DM7b1OKj.cjs} +38 -262
- package/dist/{api-Dib0dmqC.mjs → api-Hov8p7CA.mjs} +32 -256
- package/dist/{apiMachine-DNTJidYH.mjs → apiMachine-CwGEhQDT.mjs} +62 -15
- package/dist/{apiMachine-QhK-sKcr.cjs → apiMachine-DkGRj-Ai.cjs} +64 -17
- package/dist/{attachmentContent-bpQTBJ0y.cjs → attachmentContent-CEm13_gF.cjs} +4 -4
- package/dist/{attachmentContent-DkkdpSSJ.mjs → attachmentContent-CIn4iPEk.mjs} +2 -2
- package/dist/{auth-BRjd2esb.mjs → auth-BG1DY0gj.mjs} +5 -5
- package/dist/{auth-DgIV0Cvt.cjs → auth-CBXnm-Mj.cjs} +5 -5
- package/dist/{auth-omWDtgR8.cjs → auth-Dawj7pP5.cjs} +8 -8
- package/dist/{auth-DNct7VUi.mjs → auth-rggxMpEE.mjs} +8 -8
- package/dist/{auto-DKGFOJBo.mjs → auto-CXXLXGeL.mjs} +19 -18
- package/dist/{auto-CI16FZmX.cjs → auto-CbYOfoPS.cjs} +19 -18
- package/dist/{backgroundTaskActivity-BVwJBl02.mjs → backgroundTaskActivity-8PdPxrvy.mjs} +1 -1
- package/dist/{bootstrap-DCQ87Aan.cjs → bootstrap-DoA7okld.cjs} +2 -2
- package/dist/{bootstrap-BUagGC_-.mjs → bootstrap-Dt5I1SOl.mjs} +2 -2
- package/dist/{browser-Dj_DYQEh.mjs → browser-DUNetFT4.mjs} +1 -1
- package/dist/{browser-CSKhc0Bl.cjs → browser-DZ6qRtfH.cjs} +1 -1
- package/dist/{claudeCliPath-U4HHmV4r.cjs → claudeCliPath-GaP3UUz1.cjs} +1 -1
- package/dist/{claudeLocal-CdIVnOZp.cjs → claudeLocal--DNyMOSv.cjs} +8 -7
- package/dist/{claudeLocal-CCCvAeMd.mjs → claudeLocal-OHWQigCl.mjs} +6 -5
- package/dist/{claudeLocalLauncher-BmrpaRYJ.mjs → claudeLocalLauncher-BStvfa7M.mjs} +11 -10
- package/dist/{claudeLocalLauncher-21-xh5gc.cjs → claudeLocalLauncher-BhvPbcyH.cjs} +13 -12
- package/dist/{claudeSessionFork-kYCP1IJB.cjs → claudeSessionFork-Be16vzGc.cjs} +1 -1
- package/dist/{claudeSessionFork-DvxMKAmY.mjs → claudeSessionFork-GAVWhiKG.mjs} +1 -1
- package/dist/{client-C4zKGjiJ.cjs → client-BWjaHKtj.cjs} +2 -2
- package/dist/client-Ca5Pcgy_.mjs +71 -0
- package/dist/{client-CnlkkrZO.mjs → client-CnB7kRCT.mjs} +2 -2
- package/dist/{client-BTX9hsbr.mjs → client-D4uPb1uu.mjs} +3 -3
- package/dist/client-DJplzPjD.cjs +76 -0
- package/dist/{client-Dnza1hgN.cjs → client-D_loZ9IK.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +24 -15
- package/dist/codex/happyMcpStdioBridge.mjs +25 -16
- package/dist/{codexAppServerClient-DvkpQgyv.mjs → codexAppServerClient-CO4G6OS4.mjs} +3 -3
- package/dist/{codexAppServerClient-CRlBWGn3.cjs → codexAppServerClient-PE-12AsW.cjs} +3 -3
- package/dist/{codexCommand-DzxIWXIT.cjs → codexCommand-BNoD1t1C.cjs} +127 -116
- package/dist/{codexCommand-BxjogBzU.mjs → codexCommand-B_xUH79E.mjs} +77 -66
- package/dist/{codexTermination-C28FzlLb.cjs → codexTermination-BmBbizFK.cjs} +7 -2
- package/dist/{codexTermination-ySDNMEhd.mjs → codexTermination-Dx48ma6e.mjs} +7 -2
- package/dist/{config-BFB5uJ4t.cjs → config-CtwEUxUP.cjs} +26 -26
- package/dist/{config-DwfEpFr3.mjs → config-DSu0Blos.mjs} +3 -3
- package/dist/{configuration-4TGMrjul.cjs → configuration-CYO-kPOS.cjs} +1 -1
- package/dist/{configuration-DVrb61aY.mjs → configuration-PxzEJumr.mjs} +1 -1
- package/dist/{connect-C7FPY0PI.mjs → connect-BQrg3TB6.mjs} +15 -15
- package/dist/{connect-QH2VJGBG.cjs → connect-Dq7wndzR.cjs} +28 -28
- package/dist/{context-JoKu0V54.cjs → context-6TP-iz_c.cjs} +1 -1
- package/dist/{context-B3XPVJlj.mjs → context-CJGRRGWW.mjs} +1 -1
- package/dist/{controlClient-BTaZlbC6.cjs → controlClient-Bqv5v5OM.cjs} +3 -3
- package/dist/{controlClient-BYKyGyxj.mjs → controlClient-DoeYovwP.mjs} +4 -4
- package/dist/{createSessionMetadata-8Fuj2-IV.mjs → createSessionMetadata-DDIChCx8.mjs} +2 -2
- package/dist/{createSessionMetadata-B2NynaWZ.cjs → createSessionMetadata-xz767pcG.cjs} +3 -3
- package/dist/{defaultPermissionMode-BEWCqJU-.cjs → defaultPermissionMode-PkZGsQDk.cjs} +2 -2
- package/dist/{defaultPermissionMode-B8kJG9uI.mjs → defaultPermissionMode-i5KzdK09.mjs} +2 -2
- package/dist/{detectCLI-DR9ZaN6B.cjs → detectCLI-BuYR_Qxe.cjs} +4 -4
- package/dist/{deterministicJson-C5ZwZ7hu.mjs → deterministicJson-CTEJDqtS.mjs} +217 -12
- package/dist/{deterministicJson-BjNQsAjO.cjs → deterministicJson-xqA6DaOm.cjs} +222 -16
- package/dist/{doctor-BshRnjLi.cjs → doctor-BrgSlfXn.cjs} +9 -9
- package/dist/{doctor-0BiGwJXk.mjs → doctor-IctjVh9T.mjs} +8 -8
- package/dist/{doctorReadiness-BCZGcN0a.cjs → doctorReadiness-Dl6yRQCy.cjs} +1 -1
- package/dist/{downloadTarget-BN5vZt3K.cjs → downloadTarget-CEb9che-.cjs} +6 -6
- package/dist/{downloadTarget-DJPwAZlu.mjs → downloadTarget-jbOz1egC.mjs} +6 -6
- package/dist/{ensureDaemonRunning-C5QfToCe.cjs → ensureDaemonRunning-D-HyjGIX.cjs} +6 -6
- package/dist/{ensureDaemonRunning-CSmb_mqt.mjs → ensureDaemonRunning-b1e8LCSM.mjs} +5 -5
- package/dist/{handleResumeCommand-BwnUZmbo.cjs → handleResumeCommand-BvWVuRwH.cjs} +23 -7
- package/dist/{handleResumeCommand-CgjpsdDe.mjs → handleResumeCommand-DpaZvm2c.mjs} +22 -6
- package/dist/{index-piJPsTsm.cjs → index-B2p2Mut7.cjs} +259 -53
- package/dist/{index-BehVbAsA.mjs → index-BUNnpGFF.mjs} +256 -50
- package/dist/{index-Bvldtdny.mjs → index-Bsvbgh9e.mjs} +4 -4
- package/dist/{index-BYOZ_8WZ.cjs → index-C64Ufj4D.cjs} +4 -4
- package/dist/{index-Clqlu17M.mjs → index-C6Vn5Eac.mjs} +155 -34
- package/dist/index-CMf5VbzG.mjs +18 -0
- package/dist/index-DmTlDRSL.cjs +24 -0
- package/dist/{index-_l1Sdmbi.cjs → index-Dv0Q48P3.cjs} +156 -33
- package/dist/{index-BRClDe07.cjs → index-F2UejqYs.cjs} +3 -3
- package/dist/{index-BYgfern_.mjs → index-wCbtF4BK.mjs} +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
- package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
- package/dist/{install-TO4taKW7.cjs → install-C0ANcEAW.cjs} +7 -7
- package/dist/{install-fYWHrPcC.mjs → install-CdzSV7qO.mjs} +3 -3
- package/dist/{installPiTools-BKnXjrVu.cjs → installPiTools-CL_axh_6.cjs} +1 -1
- package/dist/{installTerminalHooks-BQZbvxsZ.cjs → installTerminalHooks-BETLKAtd.cjs} +3 -3
- package/dist/lib.cjs +14 -14
- package/dist/lib.d.cts +239 -2
- package/dist/lib.d.mts +239 -2
- package/dist/lib.mjs +14 -14
- package/dist/{lidState-BeOwj6eW.cjs → lidState-DWGnm2H4.cjs} +1 -1
- package/dist/{lidState-DNMlIhX0.mjs → lidState-bBrmaQd2.mjs} +1 -1
- package/dist/{localHappyAgentAuth-Br-mgogg.cjs → localHappyAgentAuth-DZHQnIW9.cjs} +1 -1
- package/dist/{localHappyAgentAuth-BezKSFDi.mjs → localHappyAgentAuth-Dn1jYDpt.mjs} +1 -1
- package/dist/{logger--vAVtXB_.mjs → logger-BUngm5Xg.mjs} +2 -2
- package/dist/{logger-DXTWlPzP.cjs → logger-CphW5nUE.cjs} +2 -2
- package/dist/machineMetadata-BQm9YTcI.cjs +79 -0
- package/dist/machineMetadata-BXN_bKU3.mjs +68 -0
- package/dist/{main-DoMFJ2Cl.cjs → main-B2UV51nK.cjs} +112 -132
- package/dist/{main-CshDb5-1.mjs → main-DGkdYfEq.mjs} +106 -126
- package/dist/{mcp-pNc1EbQf.cjs → mcp-BFvAEIRz.cjs} +15 -15
- package/dist/{mcp-DKT_lrvQ.mjs → mcp-CbTtbs0f.mjs} +15 -15
- package/dist/{mirrorProtocol-6IFGPpjJ.mjs → mirrorProtocol-BR4luBC0.mjs} +148 -7
- package/dist/{mirrorProtocol-qKflWTX_.cjs → mirrorProtocol-HKPivs5o.cjs} +150 -4
- package/dist/{package-B7B03ejW.mjs → package-7Ld1YMhh.mjs} +8 -7
- package/dist/{package-DY4zTbKS.cjs → package-KhLqBDX9.cjs} +8 -7
- package/dist/panels-C7IVqpJk.mjs +137 -0
- package/dist/panels-Njf6GelF.cjs +142 -0
- package/dist/{peerTools-3R9RUARX.mjs → peerTools-BOlDRyhi.mjs} +60 -10
- package/dist/{peerTools-iy3_6Yc5.cjs → peerTools-DQNlrcqM.cjs} +60 -9
- package/dist/{persistence-BfX72dne.cjs → persistence-9BMYspxG.cjs} +2 -2
- package/dist/{persistence-DTk4sNpd.mjs → persistence-BFUOHW5h.mjs} +3 -3
- package/dist/{piRunnerArgs-CRQVR9o-.cjs → piRunnerArgs-DGaq6VYM.cjs} +8 -2
- package/dist/{piRunnerArgs-AT8QJY7x.mjs → piRunnerArgs-H2pgpA5z.mjs} +7 -1
- package/dist/{piRuntime-BHRT5MKO.cjs → piRuntime-CT5xv_3h.cjs} +2 -2
- package/dist/{piRuntime-E44qTVQ4.mjs → piRuntime-CdN0JAsa.mjs} +2 -2
- package/dist/{piTerminal-hI4WFdWm.cjs → piTerminal-0FBtXTHK.cjs} +18 -18
- package/dist/{piTerminal-De8nbciM.mjs → piTerminal-C4m9YXAV.mjs} +18 -18
- package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
- package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
- package/dist/projectPath-C3ioB4Bu.cjs +13 -0
- package/dist/prompt-BOouDaTM.mjs +99 -0
- package/dist/prompt-lgF9IE82.cjs +105 -0
- package/dist/{attachmentLimits-UyFn8fkQ.mjs → pushNotifications-DCiBEVeC.mjs} +307 -3
- package/dist/{attachmentLimits-SqeAHrVC.cjs → pushNotifications-DI92havG.cjs} +308 -2
- package/dist/{index-DFPT4HOO.cjs → query-BETKBrnz.cjs} +25 -5
- package/dist/{index-CEjJnq05.mjs → query-ywZbQUzR.mjs} +26 -3
- package/dist/{rateLimitWindows-XrJiiBpU.mjs → rateLimitWindows-BkfuUB1a.mjs} +1 -1
- package/dist/{rateLimitWindows-Czb7_7cK.cjs → rateLimitWindows-YRIYVdo4.cjs} +1 -1
- package/dist/{registerCommonHandlers-C0_fyBQ0.cjs → registerCommonHandlers-C7a_dUWs.cjs} +30 -30
- package/dist/{registerCommonHandlers-CvIedVRf.mjs → registerCommonHandlers-CTkCvjxt.mjs} +2 -2
- package/dist/{registerKillSessionHandler-DYl7l4Ts.cjs → registerKillSessionHandler-CIsvBrVe.cjs} +6 -6
- package/dist/{registerKillSessionHandler-gwJ5lTf0.mjs → registerKillSessionHandler-CaqqRYq6.mjs} +6 -6
- package/dist/{remoteSessionClient-BRTIOX5b.cjs → remoteSessionClient-D843fkzL.cjs} +5 -5
- package/dist/{remoteSessionClient-DRb2Jr5s.mjs → remoteSessionClient-PP-mOKmw.mjs} +5 -5
- package/dist/{reportProgressTool-B9nCzbkL.cjs → reportProgressTool-14AXr959.cjs} +84 -2
- package/dist/{reportProgressTool-D5tEoXMW.mjs → reportProgressTool-ZOCNjWHr.mjs} +82 -3
- package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
- package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
- package/dist/{run-CKe_WeLW.cjs → run-CAOCYYfT.cjs} +2806 -110
- package/dist/{run-BQ_FGaOL.mjs → run-Dajw2E5j.mjs} +2787 -91
- package/dist/{runClaude-zrrNcQC_.mjs → runClaude-C6oxWYbp.mjs} +49 -47
- package/dist/{runClaude-MHI5IKM-.cjs → runClaude-CRRKt-tm.cjs} +50 -48
- package/dist/{runClaudeDeps-RRw-Nusc.cjs → runClaudeDeps-B1ysqTvx.cjs} +310 -237
- package/dist/{runClaudeDeps-CVBCokOS.mjs → runClaudeDeps-BcZ68cX3.mjs} +297 -226
- package/dist/{runGemini-kipag2ag.mjs → runGemini-D7yKc4wD.mjs} +61 -55
- package/dist/{runGemini-D7Lg9yCr.cjs → runGemini-DtKFXqf-.cjs} +89 -83
- package/dist/{runOpenClaw-C_lRY3Do.mjs → runOpenClaw-C8ilyLP9.mjs} +19 -19
- package/dist/{runOpenClaw-DCcQ0L2N.cjs → runOpenClaw-Cq29mryb.cjs} +20 -20
- package/dist/{sandbox-BSyXFVFp.mjs → sandbox-CbCutma4.mjs} +4 -4
- package/dist/{sandbox-dMwPTmjm.cjs → sandbox-gIj-EuF4.cjs} +4 -4
- package/dist/{selfCheck-DkzDDUsE.cjs → selfCheck-BTGBVthv.cjs} +39 -38
- package/dist/selfCheck-Smt-5Xiq.mjs +85 -0
- package/dist/{send-dxC0miIA.cjs → send-CZf5lLw_.cjs} +8 -8
- package/dist/{send-C-k9nsd3.mjs → send-YZRMQvMJ.mjs} +9 -9
- package/dist/{server-DxoTYNlw.mjs → server-BqwXRzFZ.mjs} +4 -4
- package/dist/{server-B-W6P7Qr.cjs → server-CknFq6xG.cjs} +6 -6
- package/dist/sessionExitLifecycle-CzkLIgNZ.mjs +142 -0
- package/dist/sessionExitLifecycle-DFltxXU8.cjs +148 -0
- package/dist/{sessionLock-DWX6BbiU.cjs → sessionLock-DRZUcKHT.cjs} +38 -5
- package/dist/{sessionLock-DBdtZGOL.mjs → sessionLock-nBXdJxJm.mjs} +36 -5
- package/dist/{sessionOps-BAnr7n8t.cjs → sessionOps-BrGiU9-s.cjs} +10 -5
- package/dist/{sessionOps-BVoXe12O.mjs → sessionOps-C58iDeD5.mjs} +11 -6
- package/dist/{sessionScanner-BtxoeluY.mjs → sessionScanner-Bm57LEXe.mjs} +3 -3
- package/dist/{sessionScanner-CDOYsEUD.cjs → sessionScanner-CaO8bLaG.cjs} +3 -3
- package/dist/{sessions-C3sZJkzI.mjs → sessions-BXyBHo8n.mjs} +40 -18
- package/dist/{sessions-hAitoN-m.cjs → sessions-uzqPCc37.cjs} +39 -16
- package/dist/{setupOfflineReconnection-_eD4cuUT.mjs → setupOfflineReconnection-1Qlek3wl.mjs} +2 -2
- package/dist/{setupOfflineReconnection-C2EeYTFH.cjs → setupOfflineReconnection-DvvVX3TB.cjs} +2 -2
- package/dist/{spawn-Bc9v7pIf.cjs → spawn-DBkodJEO.cjs} +49 -18
- package/dist/{spawn-qNrB2CD_.mjs → spawn-vn93PhYL.mjs} +49 -18
- package/dist/spawnAgents-CgPMWexP.mjs +79 -0
- package/dist/{spawnAgents-BVEaz35W.cjs → spawnAgents-DLNMlhWJ.cjs} +37 -1
- package/dist/{spawnHappyCLI-C2stUioM.mjs → spawnHappyCLI-BjFZc_7V.mjs} +1 -1
- package/dist/{spawnHappyCLI-fzUagkKV.cjs → spawnHappyCLI-DnUZv0X2.cjs} +2 -2
- package/dist/{specialCommands-BJ-nqY4s.cjs → specialCommands-BRufxlqe.cjs} +3 -3
- package/dist/{specialCommands-C6W-rVyh.mjs → specialCommands-D3ND9bdg.mjs} +3 -3
- package/dist/{startFileWatcher-Bqlqjt93.cjs → startFileWatcher-D9cYzZOq.cjs} +1 -1
- package/dist/{startFileWatcher-CR09Snmz.mjs → startFileWatcher-DXJ7yB5v.mjs} +1 -1
- package/dist/startupSessionCreate-kdr3m1uX.cjs +26 -0
- package/dist/startupSessionCreate-uZ6BM0ty.mjs +24 -0
- package/dist/{streamRelay-CJoMk_d2.mjs → streamRelay-DnMCMMfV.mjs} +1 -1
- package/dist/{streamRelay-9kBPpbvU.cjs → streamRelay-Dy6amlzx.cjs} +1 -1
- package/dist/{sync-Dhmtk66S.cjs → sync-Bn-idAoy.cjs} +1 -1
- package/dist/{sync-DbW07iQS.mjs → sync-BvVhDO40.mjs} +1 -1
- package/dist/{systemPrompt-CQcuUmVp.mjs → systemPrompt-CIZcJuJF.mjs} +4 -3
- package/dist/{systemPrompt-3PYi3EUY.cjs → systemPrompt-DlyEk35T.cjs} +4 -3
- package/dist/{teams-DpxLcUU_.cjs → teams-BLeRpDxv.cjs} +8 -8
- package/dist/{teams-CwF4Z2fA.mjs → teams-DLY3B5yi.mjs} +8 -8
- package/dist/{time-A6zR3Iy6.cjs → time-Cjv0zxQO.cjs} +1 -1
- package/dist/{time-BuGWTVP6.mjs → time-D3ETL7Jb.mjs} +1 -1
- package/dist/{titleGenerator-D26gvNaS.cjs → titleGenerator-Cgp5ihFb.cjs} +10 -9
- package/dist/{titleGenerator-BGEzNWC9.mjs → titleGenerator-Uzbd4utr.mjs} +9 -8
- package/dist/{todo-DrZc76H5.mjs → todo-C9Ga-oEM.mjs} +6 -6
- package/dist/{todo-73g3NCIO.cjs → todo-pOMcEECE.cjs} +6 -6
- package/dist/{tools-CxJp4T1T.cjs → tools-BL7Byl_x.cjs} +1 -1
- package/dist/{tools-BtsrQnNS.mjs → tools-Cho7iIWf.mjs} +1 -1
- package/dist/{uninstall-DWNYvewQ.cjs → uninstall-CbayEVoV.cjs} +6 -6
- package/dist/{uninstall-DOb2mTwV.mjs → uninstall-CvZHVY9C.mjs} +3 -3
- package/dist/webPanels-B2_C2-3g.mjs +49 -0
- package/dist/webPanels-FCgFKvVe.cjs +53 -0
- package/package.json +8 -7
- package/dist/machineMetadata-B1H9gNbN.mjs +0 -39
- package/dist/machineMetadata-DcUupMje.cjs +0 -42
- package/dist/messageBuffer-BWlGgR3A.mjs +0 -71
- package/dist/messageBuffer-fJMH6uY8.cjs +0 -73
- package/dist/projectPath-ChLhdOyt.cjs +0 -13
- package/dist/selfCheck-CF7XGJPb.mjs +0 -84
- package/dist/sessionModeFile-ByLbXTbg.mjs +0 -32
- package/dist/sessionModeFile-CLLdidiJ.cjs +0 -36
- package/dist/spawnAgents-Bw6j4tqz.mjs +0 -45
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { l as logger, r as redactLogValue } from './logger
|
|
3
|
-
import { R as RpcHandlerManager, a as answerSocketRequest, c as connectGuarded, s as socketConnectGuard, d as describeSocketAckDrop, b as safeAck, i as isRateQuotaCode, p as pauseForRateQuota, e as shouldReconnect } from './lidState-
|
|
2
|
+
import { l as logger, r as redactLogValue } from './logger-BUngm5Xg.mjs';
|
|
3
|
+
import { R as RpcHandlerManager, a as answerSocketRequest, c as connectGuarded, s as socketConnectGuard, d as describeSocketAckDrop, b as safeAck, i as isRateQuotaCode, p as pauseForRateQuota, e as shouldReconnect } from './lidState-bBrmaQd2.mjs';
|
|
4
4
|
import { EventEmitter } from 'node:events';
|
|
5
5
|
import { io } from 'socket.io-client';
|
|
6
|
-
import { A as AsyncLock, a as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema } from './
|
|
6
|
+
import { A as AsyncLock, a as MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES, U as UserMessageSchema, F as FileEventMessageSchema, P as PushNotificationClient } from './pushNotifications-DCiBEVeC.mjs';
|
|
7
7
|
import { h as decrypt, d as decodeBase64, i as decryptBlob, e as encodeBase64, g as encrypt, l as libsodiumEncryptForPublicKey, j as libsodiumPublicKeyFromSecretKey, k as getRandomBytes } from './authRelay-DhQhkBvX.mjs';
|
|
8
8
|
import { p as prepareClipboardText, d as prepareClipboardHistoryText } from './limits-DIo7rEBR.mjs';
|
|
9
|
-
import { b as backoff, d as delay, e as exponentialBackoffDelay } from './time-
|
|
10
|
-
import { c as configuration } from './configuration-
|
|
9
|
+
import { b as backoff, d as delay, e as exponentialBackoffDelay } from './time-D3ETL7Jb.mjs';
|
|
10
|
+
import { c as configuration } from './configuration-PxzEJumr.mjs';
|
|
11
11
|
import { createHmac, randomUUID } from 'node:crypto';
|
|
12
|
-
import {
|
|
13
|
-
import { r as registerCommonHandlers } from './registerCommonHandlers-
|
|
12
|
+
import { d as createEnvelope, s as streamKeyOf, R as ReleaseDrainNoticeSchema, t as RelayAssignmentResponseSchema } from './index-C6Vn5Eac.mjs';
|
|
13
|
+
import { r as registerCommonHandlers } from './registerCommonHandlers-CTkCvjxt.mjs';
|
|
14
14
|
import { createId } from '@paralleldrive/cuid2';
|
|
15
|
-
import { I as InvalidateSync } from './sync-
|
|
16
|
-
import { B as BackgroundTaskReporter } from './backgroundTaskActivity-
|
|
17
|
-
import { k as notifyDaemonTurnEvent, m as notifyDaemonBackgroundTasks } from './controlClient-
|
|
18
|
-
import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
15
|
+
import { I as InvalidateSync } from './sync-BvVhDO40.mjs';
|
|
16
|
+
import { B as BackgroundTaskReporter } from './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
17
|
+
import { k as notifyDaemonTurnEvent, m as notifyDaemonBackgroundTasks } from './controlClient-DoeYovwP.mjs';
|
|
19
18
|
import chalk from 'chalk';
|
|
20
19
|
|
|
21
20
|
async function hmac_sha512(key, data) {
|
|
@@ -881,6 +880,7 @@ function isQueuedUserText(body) {
|
|
|
881
880
|
return record.role === "user" && record.content?.type === "text" && typeof record.meta?.queuedAt === "number";
|
|
882
881
|
}
|
|
883
882
|
function scanUndeliveredQueuedInputs(records, prior) {
|
|
883
|
+
const replayAboveSeq = prior?.replayAboveSeq;
|
|
884
884
|
const canceled = prior?.canceled ?? /* @__PURE__ */ new Set();
|
|
885
885
|
const undelivered = [];
|
|
886
886
|
let reachedBoundary = false;
|
|
@@ -899,6 +899,7 @@ function scanUndeliveredQueuedInputs(records, prior) {
|
|
|
899
899
|
}
|
|
900
900
|
continue;
|
|
901
901
|
}
|
|
902
|
+
if (replayAboveSeq !== void 0 && record.seq > replayAboveSeq) continue;
|
|
902
903
|
if (isQueuedUserText(record.body) && record.localId && !canceled.has(record.localId)) {
|
|
903
904
|
undelivered.push(record.localId);
|
|
904
905
|
}
|
|
@@ -1873,7 +1874,7 @@ class ApiSessionClient extends EventEmitter {
|
|
|
1873
1874
|
* session down. Needs no socket; POSTs through the same session-message
|
|
1874
1875
|
* channel so the web receives it identically to a cancel-button tombstone.
|
|
1875
1876
|
*/
|
|
1876
|
-
async cancelUndeliveredQueuedInputs() {
|
|
1877
|
+
async cancelUndeliveredQueuedInputs(opts) {
|
|
1877
1878
|
const MAX_SCAN_PAGES = 10;
|
|
1878
1879
|
const canceled = /* @__PURE__ */ new Set();
|
|
1879
1880
|
const undelivered = [];
|
|
@@ -1902,7 +1903,7 @@ class ApiSessionClient extends EventEmitter {
|
|
|
1902
1903
|
}
|
|
1903
1904
|
return { seq: message.seq, localId: message.localId, body };
|
|
1904
1905
|
});
|
|
1905
|
-
const scan = scanUndeliveredQueuedInputs(records, { canceled });
|
|
1906
|
+
const scan = scanUndeliveredQueuedInputs(records, { canceled, replayAboveSeq: opts?.maxSeq });
|
|
1906
1907
|
for (const key of scan.canceled) canceled.add(key);
|
|
1907
1908
|
undelivered.push(...scan.undeliveredLocalKeys);
|
|
1908
1909
|
reachedBoundary = scan.reachedBoundary;
|
|
@@ -1956,6 +1957,17 @@ class ApiSessionClient extends EventEmitter {
|
|
|
1956
1957
|
* own line, so a launcher sends the matching session event only when this
|
|
1957
1958
|
* says the turn-end did not carry it).
|
|
1958
1959
|
*/
|
|
1960
|
+
/**
|
|
1961
|
+
* B-495: close the turn a fork backfill left open. History, not a live
|
|
1962
|
+
* turn end — so no `turn-ended` tap (board analyzer, completion hooks).
|
|
1963
|
+
*/
|
|
1964
|
+
closeReplayedClaudeTurn() {
|
|
1965
|
+
const mapped = closeClaudeTurnWithStatus(this.claudeSessionProtocolState, "completed");
|
|
1966
|
+
this.claudeSessionProtocolState.currentTurnId = mapped.currentTurnId;
|
|
1967
|
+
for (const envelope of mapped.envelopes) {
|
|
1968
|
+
this.sendSessionProtocolMessage(envelope);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1959
1971
|
closeClaudeSessionTurn(status = "completed", meta) {
|
|
1960
1972
|
this.emit("turn-ended", status);
|
|
1961
1973
|
const mapped = closeClaudeTurnWithStatus(this.claudeSessionProtocolState, status, meta);
|
|
@@ -2435,248 +2447,6 @@ class ApiSessionClient extends EventEmitter {
|
|
|
2435
2447
|
}
|
|
2436
2448
|
}
|
|
2437
2449
|
|
|
2438
|
-
function getSessionTitle(metadata) {
|
|
2439
|
-
const summaryText = metadata?.summary?.text?.trim();
|
|
2440
|
-
if (summaryText) {
|
|
2441
|
-
return summaryText;
|
|
2442
|
-
}
|
|
2443
|
-
const path = metadata?.path?.trim();
|
|
2444
|
-
if (!path) {
|
|
2445
|
-
return "Session";
|
|
2446
|
-
}
|
|
2447
|
-
const segments = path.split(/[\\/]/).filter(Boolean);
|
|
2448
|
-
return segments[segments.length - 1] || "Session";
|
|
2449
|
-
}
|
|
2450
|
-
function getSessionNotificationUrl(data) {
|
|
2451
|
-
const sessionId = data?.sessionId;
|
|
2452
|
-
if (typeof sessionId !== "string") {
|
|
2453
|
-
return null;
|
|
2454
|
-
}
|
|
2455
|
-
const trimmedSessionId = sessionId.trim();
|
|
2456
|
-
if (!trimmedSessionId) {
|
|
2457
|
-
return null;
|
|
2458
|
-
}
|
|
2459
|
-
return `/session/${encodeURIComponent(trimmedSessionId)}`;
|
|
2460
|
-
}
|
|
2461
|
-
function getSessionNotificationTitle(kind) {
|
|
2462
|
-
switch (kind) {
|
|
2463
|
-
case "done":
|
|
2464
|
-
return "It's ready!";
|
|
2465
|
-
case "permission":
|
|
2466
|
-
return "Permission request";
|
|
2467
|
-
case "question":
|
|
2468
|
-
return "Clarification needed";
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
function getSessionNotificationBody(metadata) {
|
|
2472
|
-
return getSessionTitle(metadata);
|
|
2473
|
-
}
|
|
2474
|
-
function getSessionNotificationCopy(kind, metadata) {
|
|
2475
|
-
return {
|
|
2476
|
-
title: getSessionNotificationTitle(kind),
|
|
2477
|
-
body: getSessionNotificationBody(metadata)
|
|
2478
|
-
};
|
|
2479
|
-
}
|
|
2480
|
-
class PushNotificationClient {
|
|
2481
|
-
token;
|
|
2482
|
-
baseUrl;
|
|
2483
|
-
expoLoad = null;
|
|
2484
|
-
constructor(token, baseUrl = "https://api.cluster-fluster.com") {
|
|
2485
|
-
this.token = token;
|
|
2486
|
-
this.baseUrl = baseUrl;
|
|
2487
|
-
}
|
|
2488
|
-
loadExpo() {
|
|
2489
|
-
if (!this.expoLoad) {
|
|
2490
|
-
const load = import('expo-server-sdk').then(({ Expo }) => ({ Expo, expo: new Expo() }));
|
|
2491
|
-
load.catch(() => {
|
|
2492
|
-
if (this.expoLoad === load) this.expoLoad = null;
|
|
2493
|
-
});
|
|
2494
|
-
this.expoLoad = load;
|
|
2495
|
-
}
|
|
2496
|
-
return this.expoLoad;
|
|
2497
|
-
}
|
|
2498
|
-
/**
|
|
2499
|
-
* Fetch all push tokens for the authenticated user.
|
|
2500
|
-
* Retries up to 3 times with exponential backoff on transient errors.
|
|
2501
|
-
*/
|
|
2502
|
-
async fetchPushTokens() {
|
|
2503
|
-
const maxAttempts = 3;
|
|
2504
|
-
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
2505
|
-
try {
|
|
2506
|
-
const response = await axios.get(
|
|
2507
|
-
`${this.baseUrl}/v1/push-tokens`,
|
|
2508
|
-
{
|
|
2509
|
-
headers: {
|
|
2510
|
-
"Authorization": `Bearer ${this.token}`,
|
|
2511
|
-
"Content-Type": "application/json",
|
|
2512
|
-
"X-Happy-Client": `cli-daemon/${configuration.currentCliVersion}`
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
);
|
|
2516
|
-
logger.debug(`Fetched ${response.data.tokens.length} push tokens`);
|
|
2517
|
-
response.data.tokens.forEach((token, index) => {
|
|
2518
|
-
logger.debug(`[PUSH] Token ${index + 1}: id=${token.id}, created=${new Date(token.createdAt).toISOString()}, updated=${new Date(token.updatedAt).toISOString()}`);
|
|
2519
|
-
});
|
|
2520
|
-
return response.data.tokens;
|
|
2521
|
-
} catch (error) {
|
|
2522
|
-
logger.debug(`[PUSH] [ERROR] Failed to fetch push tokens (attempt ${attempt}/${maxAttempts}):`, error);
|
|
2523
|
-
if (attempt < maxAttempts) {
|
|
2524
|
-
const delay = 1e3 * Math.pow(2, attempt - 1);
|
|
2525
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
2526
|
-
}
|
|
2527
|
-
}
|
|
2528
|
-
}
|
|
2529
|
-
logger.debug("[PUSH] [ERROR] All push token fetch attempts failed");
|
|
2530
|
-
return [];
|
|
2531
|
-
}
|
|
2532
|
-
/**
|
|
2533
|
-
* Send push notification via Expo Push API with retry
|
|
2534
|
-
* @param messages - Array of push messages to send
|
|
2535
|
-
*/
|
|
2536
|
-
async sendPushNotifications(messages) {
|
|
2537
|
-
logger.debug(`Sending ${messages.length} push notifications`);
|
|
2538
|
-
const { Expo, expo } = await this.loadExpo();
|
|
2539
|
-
const validMessages = messages.filter((message) => {
|
|
2540
|
-
if (Array.isArray(message.to)) {
|
|
2541
|
-
return message.to.every((token) => Expo.isExpoPushToken(token));
|
|
2542
|
-
}
|
|
2543
|
-
return Expo.isExpoPushToken(message.to);
|
|
2544
|
-
});
|
|
2545
|
-
if (validMessages.length === 0) {
|
|
2546
|
-
logger.debug("No valid Expo push tokens found");
|
|
2547
|
-
return;
|
|
2548
|
-
}
|
|
2549
|
-
const chunks = expo.chunkPushNotifications(validMessages);
|
|
2550
|
-
for (const chunk of chunks) {
|
|
2551
|
-
const startTime = Date.now();
|
|
2552
|
-
const timeout = 3e5;
|
|
2553
|
-
let attempt = 0;
|
|
2554
|
-
while (true) {
|
|
2555
|
-
try {
|
|
2556
|
-
const ticketChunk = await expo.sendPushNotificationsAsync(chunk);
|
|
2557
|
-
const errors = ticketChunk.filter((ticket) => ticket.status === "error");
|
|
2558
|
-
if (errors.length > 0) {
|
|
2559
|
-
const errorDetails = errors.map((e) => ({ message: e.message, details: e.details }));
|
|
2560
|
-
logger.debug("[PUSH] Some notifications failed:", errorDetails);
|
|
2561
|
-
}
|
|
2562
|
-
if (errors.length === ticketChunk.length) {
|
|
2563
|
-
throw new Error("All push notifications in chunk failed");
|
|
2564
|
-
}
|
|
2565
|
-
break;
|
|
2566
|
-
} catch (error) {
|
|
2567
|
-
const elapsed = Date.now() - startTime;
|
|
2568
|
-
if (elapsed >= timeout) {
|
|
2569
|
-
logger.debug("[PUSH] Timeout reached after 5 minutes, giving up on chunk");
|
|
2570
|
-
break;
|
|
2571
|
-
}
|
|
2572
|
-
attempt++;
|
|
2573
|
-
const delay = Math.min(1e3 * Math.pow(2, attempt), 3e4);
|
|
2574
|
-
const remainingTime = timeout - elapsed;
|
|
2575
|
-
const waitTime = Math.min(delay, remainingTime);
|
|
2576
|
-
if (waitTime > 0) {
|
|
2577
|
-
logger.debug(`[PUSH] Retrying in ${waitTime}ms (attempt ${attempt})`);
|
|
2578
|
-
await new Promise((resolve) => setTimeout(resolve, waitTime));
|
|
2579
|
-
}
|
|
2580
|
-
}
|
|
2581
|
-
}
|
|
2582
|
-
}
|
|
2583
|
-
logger.debug(`Push notifications sent successfully`);
|
|
2584
|
-
}
|
|
2585
|
-
/**
|
|
2586
|
-
* Send a push notification to all registered devices for the user
|
|
2587
|
-
* @param title - Notification title
|
|
2588
|
-
* @param body - Notification body
|
|
2589
|
-
* @param data - Additional data to send with the notification
|
|
2590
|
-
*/
|
|
2591
|
-
sendToAllDevices(title, body, data) {
|
|
2592
|
-
logger.debug("[PUSH] sendToAllDevices called:", {
|
|
2593
|
-
title: contentLogMetadata(title),
|
|
2594
|
-
body: contentLogMetadata(body),
|
|
2595
|
-
dataKeyCount: data ? Object.keys(data).length : 0
|
|
2596
|
-
});
|
|
2597
|
-
(async () => {
|
|
2598
|
-
try {
|
|
2599
|
-
logger.debug("[PUSH] Fetching push tokens...");
|
|
2600
|
-
const tokens = await this.fetchPushTokens();
|
|
2601
|
-
logger.debug(`[PUSH] Fetched ${tokens.length} push tokens`);
|
|
2602
|
-
tokens.forEach((token, index) => {
|
|
2603
|
-
logger.debug(`[PUSH] Using token ${index + 1}: id=${token.id}`);
|
|
2604
|
-
});
|
|
2605
|
-
if (tokens.length === 0) {
|
|
2606
|
-
logger.debug("No push tokens found for user");
|
|
2607
|
-
return;
|
|
2608
|
-
}
|
|
2609
|
-
const messages = tokens.map((token, index) => {
|
|
2610
|
-
logger.debug(`[PUSH] Creating message ${index + 1} for token`);
|
|
2611
|
-
return {
|
|
2612
|
-
to: token.token,
|
|
2613
|
-
title,
|
|
2614
|
-
body: body && body.length > 0 ? body : void 0,
|
|
2615
|
-
data,
|
|
2616
|
-
// TODO: For brutalist session artwork, attach rich media via a public HTTPS image URL.
|
|
2617
|
-
// Bundled app asset paths / require(...) / local file paths will not work in push payloads.
|
|
2618
|
-
// iOS also needs a Notification Service Extension to render richContent.image reliably.
|
|
2619
|
-
sound: "default",
|
|
2620
|
-
priority: "high"
|
|
2621
|
-
};
|
|
2622
|
-
});
|
|
2623
|
-
logger.debug(`[PUSH] Sending ${messages.length} push notifications...`);
|
|
2624
|
-
await this.sendPushNotifications(messages);
|
|
2625
|
-
logger.debug("[PUSH] Push notifications sent successfully");
|
|
2626
|
-
} catch (error) {
|
|
2627
|
-
logger.debug("[PUSH] Error sending to all devices:", error);
|
|
2628
|
-
}
|
|
2629
|
-
})();
|
|
2630
|
-
}
|
|
2631
|
-
/**
|
|
2632
|
-
* Routes session-event pushes through the server so it can apply
|
|
2633
|
-
* presence-based suppression (active desktop/web, mobile foreground).
|
|
2634
|
-
* Falls back to direct Expo send only when sessionId is missing — that
|
|
2635
|
-
* shouldn't happen for session notifications but guards against regressions.
|
|
2636
|
-
*/
|
|
2637
|
-
sendSessionNotification(params) {
|
|
2638
|
-
const { title, body } = getSessionNotificationCopy(params.kind, params.metadata);
|
|
2639
|
-
const sessionTitle = getSessionNotificationBody(params.metadata);
|
|
2640
|
-
const url = getSessionNotificationUrl(params.data);
|
|
2641
|
-
const payloadData = {
|
|
2642
|
-
...params.data,
|
|
2643
|
-
kind: params.kind,
|
|
2644
|
-
sessionTitle,
|
|
2645
|
-
...url ? { url } : {}
|
|
2646
|
-
};
|
|
2647
|
-
const sessionId = typeof params.data?.sessionId === "string" ? params.data.sessionId : null;
|
|
2648
|
-
if (!sessionId) {
|
|
2649
|
-
logger.debug("[PUSH] sendSessionNotification: missing sessionId, falling back to direct send");
|
|
2650
|
-
this.sendToAllDevices(title, body, payloadData);
|
|
2651
|
-
return;
|
|
2652
|
-
}
|
|
2653
|
-
void (async () => {
|
|
2654
|
-
try {
|
|
2655
|
-
await axios.post(
|
|
2656
|
-
`${this.baseUrl}/v1/sessions/${encodeURIComponent(sessionId)}/push-event`,
|
|
2657
|
-
{
|
|
2658
|
-
kind: params.kind,
|
|
2659
|
-
title,
|
|
2660
|
-
body,
|
|
2661
|
-
data: payloadData
|
|
2662
|
-
},
|
|
2663
|
-
{
|
|
2664
|
-
headers: {
|
|
2665
|
-
"Authorization": `Bearer ${this.token}`,
|
|
2666
|
-
"Content-Type": "application/json",
|
|
2667
|
-
"X-Happy-Client": `cli-daemon/${configuration.currentCliVersion}`
|
|
2668
|
-
},
|
|
2669
|
-
timeout: 15e3
|
|
2670
|
-
}
|
|
2671
|
-
);
|
|
2672
|
-
logger.debug(`[PUSH] sendSessionNotification dispatched via server (kind=${params.kind})`);
|
|
2673
|
-
} catch (error) {
|
|
2674
|
-
logger.debug("[PUSH] sendSessionNotification failed:", error);
|
|
2675
|
-
}
|
|
2676
|
-
})();
|
|
2677
|
-
}
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
2450
|
function startOfflineReconnection(config) {
|
|
2681
2451
|
let reconnected = false;
|
|
2682
2452
|
let session = null;
|
|
@@ -2787,6 +2557,12 @@ class OfflineState {
|
|
|
2787
2557
|
isOffline() {
|
|
2788
2558
|
return this.state === "offline";
|
|
2789
2559
|
}
|
|
2560
|
+
/** B-689: one-line cause of the last failure of `operation` (for exit reasons). */
|
|
2561
|
+
describe(operation) {
|
|
2562
|
+
const f = this.failures.get(operation);
|
|
2563
|
+
if (!f) return void 0;
|
|
2564
|
+
return f.errorCode ? `${f.errorCode} - ${ERROR_DESCRIPTIONS[f.errorCode] || "unknown error"}` : "unknown error";
|
|
2565
|
+
}
|
|
2790
2566
|
/** Reset for testing - clears all state */
|
|
2791
2567
|
reset() {
|
|
2792
2568
|
this.state = "online";
|
|
@@ -3171,7 +2947,7 @@ class ApiClient {
|
|
|
3171
2947
|
return new ApiSessionClient(this.credential.token, session, opts);
|
|
3172
2948
|
}
|
|
3173
2949
|
async machineSyncClient(machine) {
|
|
3174
|
-
const { ApiMachineClient } = await import('./apiMachine-
|
|
2950
|
+
const { ApiMachineClient } = await import('./apiMachine-CwGEhQDT.mjs');
|
|
3175
2951
|
return new ApiMachineClient(this.credential.token, machine);
|
|
3176
2952
|
}
|
|
3177
2953
|
push() {
|
|
@@ -1,41 +1,42 @@
|
|
|
1
1
|
import { io } from 'socket.io-client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
2
|
+
import { a as webPanelsSignature } from './webPanels-B2_C2-3g.mjs';
|
|
3
|
+
import { l as logger } from './logger-BUngm5Xg.mjs';
|
|
4
|
+
import { R as RpcHandlerManager, i as isRateQuotaCode, p as pauseForRateQuota, s as socketConnectGuard, c as connectGuarded, a as answerSocketRequest, e as shouldReconnect, d as describeSocketAckDrop } from './lidState-bBrmaQd2.mjs';
|
|
5
|
+
import { M as ModelConfigError, i as isClaudeSessionId, s as stableVersion, a as sanitizeTagList, p as pickMirrorForTerminal, l as liveSnapshotChanged, b as sanitizeLiveSnapshot, c as serializeLiveSnapshot, r as registerWorktreeHandlers, d as configureWorktreeService, e as summarizeSpawnSessionForLog, f as parseMirrorSendParams } from './mirrorProtocol-BR4luBC0.mjs';
|
|
6
|
+
import { c as configuration } from './configuration-PxzEJumr.mjs';
|
|
6
7
|
import { w as withCurrentCliUpdateState } from './cliUpdate-Y34VGe9Y.mjs';
|
|
7
|
-
import { r as registerCommonHandlers } from './registerCommonHandlers-
|
|
8
|
+
import { r as registerCommonHandlers } from './registerCommonHandlers-CTkCvjxt.mjs';
|
|
8
9
|
import { stat, readdir, lstat, open, readFile, rm, mkdir, chmod, writeFile, rename } from 'node:fs/promises';
|
|
9
10
|
import { join, isAbsolute, resolve } from 'node:path';
|
|
10
11
|
import os, { homedir } from 'node:os';
|
|
11
12
|
import { spawn, execFile, spawnSync } from 'node:child_process';
|
|
12
|
-
import { r as readSettings,
|
|
13
|
+
import { r as readSettings, c as readPersistedSessions, o as readTrackedClaudeSessionIds, p as readTrackedCodexThreadIds } from './persistence-BFUOHW5h.mjs';
|
|
13
14
|
import { e as encodeBase64, g as encrypt, h as decrypt, d as decodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
14
15
|
import { p as prepareClipboardText, d as prepareClipboardHistoryText } from './limits-DIo7rEBR.mjs';
|
|
15
|
-
import { b as backoff, d as delay } from './time-
|
|
16
|
+
import { b as backoff, d as delay } from './time-D3ETL7Jb.mjs';
|
|
16
17
|
import * as pty from 'node-pty';
|
|
17
18
|
import { a as attachStartupCommand, v as validateTerminalTags, d as deriveAutoTitle, T as TMUX_SESSION_ID_RE, i as isSafeTmuxSessionName, b as isVhSessionName, U as USER_SESSIONS_FORMAT, p as parseUserSessions, L as LIST_SESSIONS_FORMAT, c as parseSessionListLine, e as LIST_FIELD_SEP, s as sendToVhTerminal } from './terminals-Dlg0x3nY.mjs';
|
|
18
19
|
import { t as tmuxArgs, V as VH_TMUX_SOCKET_ENV, a as scrubTmuxClientEnv } from './tmuxSocket-B8Yx20sT.mjs';
|
|
19
|
-
import { locateClaudeConversation, refreshAgentHomes } from './index-
|
|
20
|
+
import { locateClaudeConversation, refreshAgentHomes } from './index-Bsvbgh9e.mjs';
|
|
20
21
|
import { randomBytes } from 'node:crypto';
|
|
21
22
|
import { readdirSync, unlinkSync, existsSync, mkdirSync, writeFileSync, readFileSync, statSync, chmodSync, renameSync, rmSync, accessSync, constants } from 'node:fs';
|
|
22
23
|
import axios from 'axios';
|
|
23
24
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
24
25
|
import { a as isValidTerminalId } from './ids-DU6sLx4C.mjs';
|
|
25
26
|
import { d as detectCLIAvailability } from './detectCLI-CSGMlV51.mjs';
|
|
26
|
-
import { d as detectResumeSupport } from './localHappyAgentAuth-
|
|
27
|
+
import { d as detectResumeSupport } from './localHappyAgentAuth-Dn1jYDpt.mjs';
|
|
27
28
|
import { g as getProjectPath, a as getClaudeProjectsRoot } from './path-D2wdaNSk.mjs';
|
|
28
29
|
import { i as isVeryHappyOneShotPrompt } from './oneShotPrompts-DT4p6RNd.mjs';
|
|
29
|
-
import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, a as forkAndTruncateSession, b as ForkTruncateUuidNotFoundError, c as forkBeforeUserMessage } from './claudeSessionFork-
|
|
30
|
-
import { C as CodexAppServerClient } from './codexAppServerClient-
|
|
31
|
-
import {
|
|
30
|
+
import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, a as forkAndTruncateSession, b as ForkTruncateUuidNotFoundError, c as forkBeforeUserMessage } from './claudeSessionFork-GAVWhiKG.mjs';
|
|
31
|
+
import { C as CodexAppServerClient } from './codexAppServerClient-CO4G6OS4.mjs';
|
|
32
|
+
import { v as RelayCandidatesResponseSchema, t as RelayAssignmentResponseSchema, R as ReleaseDrainNoticeSchema } from './index-C6Vn5Eac.mjs';
|
|
32
33
|
import { f as forkCodexThread, C as CodexForkRewindPointNotFoundError, l as listCodexRewindPoints, a as forkCodexBeforeUserMessage } from './codexThreadFork-R76RU5H0.mjs';
|
|
33
|
-
import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-
|
|
34
|
+
import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-BkfuUB1a.mjs';
|
|
34
35
|
import 'chalk';
|
|
35
36
|
import 'node:util';
|
|
36
37
|
import 'os';
|
|
37
38
|
import 'child_process';
|
|
38
|
-
import './package-
|
|
39
|
+
import './package-7Ld1YMhh.mjs';
|
|
39
40
|
import 'util';
|
|
40
41
|
import 'fs/promises';
|
|
41
42
|
import 'crypto';
|
|
@@ -345,6 +346,21 @@ function registerTodoHandlers(manager) {
|
|
|
345
346
|
});
|
|
346
347
|
}
|
|
347
348
|
|
|
349
|
+
const obj = (value) => value && typeof value === "object" ? value : {};
|
|
350
|
+
async function guarded(fn) {
|
|
351
|
+
try {
|
|
352
|
+
return await fn();
|
|
353
|
+
} catch (error) {
|
|
354
|
+
if (error instanceof ModelConfigError) return { error: error.message, code: error.code };
|
|
355
|
+
return { error: error instanceof Error ? error.message : "Unknown error", code: "internal" };
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function registerModelConfigHandlers(rpc, service) {
|
|
359
|
+
rpc.registerHandler("model-config-read", (params) => guarded(() => service.read(obj(params))));
|
|
360
|
+
rpc.registerHandler("model-config-apply", (params) => guarded(() => service.apply(obj(params))));
|
|
361
|
+
rpc.registerHandler("model-config-restore", (params) => guarded(() => service.restore(obj(params))));
|
|
362
|
+
}
|
|
363
|
+
|
|
348
364
|
function codingAgentFromProcessTree(panePid, snapshot) {
|
|
349
365
|
const rows = snapshot.split("\n").flatMap((line) => {
|
|
350
366
|
const m = line.trim().match(/^(\d+)\s+(\d+)\s+(.+)$/);
|
|
@@ -10468,6 +10484,9 @@ class ApiMachineClient {
|
|
|
10468
10484
|
claudeAuthState = null;
|
|
10469
10485
|
/** B-587: the machine's hibernation threshold, published as a capability. */
|
|
10470
10486
|
agentHibernationIdleMs = null;
|
|
10487
|
+
/** B-510: last normalized `webPanels` (null = never set → field not written). */
|
|
10488
|
+
webPanels = null;
|
|
10489
|
+
webPanelsSignatureSent = null;
|
|
10471
10490
|
rateLimitPushChain = Promise.resolve();
|
|
10472
10491
|
rateLimitPublisher = new RateLimitPublisher({
|
|
10473
10492
|
getCurrent: () => this.machine.daemonState?.rateLimits,
|
|
@@ -10647,6 +10666,27 @@ class ApiMachineClient {
|
|
|
10647
10666
|
return { agentHibernation: { idleMs } };
|
|
10648
10667
|
});
|
|
10649
10668
|
}
|
|
10669
|
+
/**
|
|
10670
|
+
* B-510: mirror the local `webPanels` declaration into daemonState. Every
|
|
10671
|
+
* daemonState write is a CAS + DB write + broadcast, so an unchanged list
|
|
10672
|
+
* (same signature as the last one sent) writes nothing.
|
|
10673
|
+
*/
|
|
10674
|
+
setWebPanels(panels) {
|
|
10675
|
+
this.webPanels = panels;
|
|
10676
|
+
const signature = webPanelsSignature(panels);
|
|
10677
|
+
if (signature === this.webPanelsSignatureSent || !this.socket?.connected) return Promise.resolve();
|
|
10678
|
+
const attempt = this.cliUpdatePushChain.then(() => this.updateDaemonState((current) => ({
|
|
10679
|
+
...current ?? {},
|
|
10680
|
+
status: current?.status ?? "running",
|
|
10681
|
+
webPanels: { panels, updatedAt: Date.now() }
|
|
10682
|
+
}))).then(() => {
|
|
10683
|
+
this.webPanelsSignatureSent = signature;
|
|
10684
|
+
}).catch((error) => {
|
|
10685
|
+
logger.debug("[API MACHINE] Failed to publish web panels:", error);
|
|
10686
|
+
});
|
|
10687
|
+
this.cliUpdatePushChain = attempt.then(() => void 0);
|
|
10688
|
+
return attempt;
|
|
10689
|
+
}
|
|
10650
10690
|
publishAgentHibernation() {
|
|
10651
10691
|
const idleMs = this.agentHibernationIdleMs;
|
|
10652
10692
|
if (idleMs === null || !this.socket?.connected) return Promise.resolve();
|
|
@@ -10677,6 +10717,10 @@ class ApiMachineClient {
|
|
|
10677
10717
|
return { claudeAuth };
|
|
10678
10718
|
});
|
|
10679
10719
|
}
|
|
10720
|
+
/** B-688 machine RPCs `model-config-*` (modules/modelConfig/modelConfigRpc.ts). */
|
|
10721
|
+
setModelConfigService(service) {
|
|
10722
|
+
registerModelConfigHandlers(this.rpcHandlerManager, service);
|
|
10723
|
+
}
|
|
10680
10724
|
/**
|
|
10681
10725
|
* B-506: the five `sessions.*` methods a CLI on ANOTHER machine of this
|
|
10682
10726
|
* account calls to read / message sessions this daemon spawned. Plaintext
|
|
@@ -11381,9 +11425,12 @@ class ApiMachineClient {
|
|
|
11381
11425
|
// leaves a stale-pid value visible longer than needed.
|
|
11382
11426
|
...this.claudeAuthState ? { claudeAuth: this.claudeAuthState } : {},
|
|
11383
11427
|
// B-587 capability + setting (same restamp discipline).
|
|
11384
|
-
...this.agentHibernationIdleMs !== null ? { agentHibernation: { idleMs: this.agentHibernationIdleMs, rpcAvailable: true, detectedAt: now } } : {}
|
|
11428
|
+
...this.agentHibernationIdleMs !== null ? { agentHibernation: { idleMs: this.agentHibernationIdleMs, rpcAvailable: true, detectedAt: now } } : {},
|
|
11429
|
+
// B-510: re-ship the declared panels (also clears a stale list).
|
|
11430
|
+
...Array.isArray(this.webPanels) ? { webPanels: { panels: this.webPanels, updatedAt: now } } : {}
|
|
11385
11431
|
};
|
|
11386
11432
|
});
|
|
11433
|
+
if (Array.isArray(this.webPanels)) this.webPanelsSignatureSent = webPanelsSignature(this.webPanels);
|
|
11387
11434
|
this.webTerminal.startListTracking((terminals) => this.pushTerminalList(terminals));
|
|
11388
11435
|
if (!rpcAlreadyRegistered) this.rpcHandlerManager.onSocketConnect(socket);
|
|
11389
11436
|
this.syncResumeSessionRpcRegistration();
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var socket_ioClient = require('socket.io-client');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
4
|
+
var webPanels = require('./webPanels-FCgFKvVe.cjs');
|
|
5
|
+
var logger = require('./logger-CphW5nUE.cjs');
|
|
6
|
+
var lidState = require('./lidState-DWGnm2H4.cjs');
|
|
7
|
+
var mirrorProtocol = require('./mirrorProtocol-HKPivs5o.cjs');
|
|
8
|
+
var configuration = require('./configuration-CYO-kPOS.cjs');
|
|
8
9
|
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
9
|
-
var registerCommonHandlers = require('./registerCommonHandlers-
|
|
10
|
+
var registerCommonHandlers = require('./registerCommonHandlers-C7a_dUWs.cjs');
|
|
10
11
|
var promises = require('node:fs/promises');
|
|
11
12
|
var path = require('node:path');
|
|
12
13
|
var os = require('node:os');
|
|
13
14
|
var node_child_process = require('node:child_process');
|
|
14
|
-
var persistence = require('./persistence-
|
|
15
|
+
var persistence = require('./persistence-9BMYspxG.cjs');
|
|
15
16
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
16
17
|
var limits = require('./limits-C-a7gr04.cjs');
|
|
17
|
-
var time = require('./time-
|
|
18
|
+
var time = require('./time-Cjv0zxQO.cjs');
|
|
18
19
|
var pty = require('node-pty');
|
|
19
20
|
var terminals = require('./terminals-B_bfC9c2.cjs');
|
|
20
21
|
var tmuxSocket = require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
21
|
-
var index = require('./index-
|
|
22
|
+
var index = require('./index-C64Ufj4D.cjs');
|
|
22
23
|
var node_crypto = require('node:crypto');
|
|
23
24
|
var node_fs = require('node:fs');
|
|
24
25
|
var axios = require('axios');
|
|
25
|
-
var projectPath = require('./projectPath-
|
|
26
|
+
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
26
27
|
var ids = require('./ids-B6ZC0HGt.cjs');
|
|
27
|
-
var detectCLI = require('./detectCLI-
|
|
28
|
-
var localHappyAgentAuth = require('./localHappyAgentAuth-
|
|
28
|
+
var detectCLI = require('./detectCLI-BuYR_Qxe.cjs');
|
|
29
|
+
var localHappyAgentAuth = require('./localHappyAgentAuth-DZHQnIW9.cjs');
|
|
29
30
|
var path$1 = require('./path-B7zW-WwE.cjs');
|
|
30
31
|
var oneShotPrompts = require('./oneShotPrompts-CL0dip9C.cjs');
|
|
31
|
-
var claudeSessionFork = require('./claudeSessionFork-
|
|
32
|
-
var codexAppServerClient = require('./codexAppServerClient-
|
|
33
|
-
var index$1 = require('./index-
|
|
32
|
+
var claudeSessionFork = require('./claudeSessionFork-Be16vzGc.cjs');
|
|
33
|
+
var codexAppServerClient = require('./codexAppServerClient-PE-12AsW.cjs');
|
|
34
|
+
var index$1 = require('./index-Dv0Q48P3.cjs');
|
|
34
35
|
var codexThreadFork = require('./codexThreadFork-DNekT4nQ.cjs');
|
|
35
|
-
var rateLimitWindows = require('./rateLimitWindows-
|
|
36
|
+
var rateLimitWindows = require('./rateLimitWindows-YRIYVdo4.cjs');
|
|
36
37
|
require('chalk');
|
|
37
38
|
require('node:util');
|
|
38
39
|
require('os');
|
|
39
40
|
require('child_process');
|
|
40
|
-
require('./package-
|
|
41
|
+
require('./package-KhLqBDX9.cjs');
|
|
41
42
|
require('util');
|
|
42
43
|
require('fs/promises');
|
|
43
44
|
require('crypto');
|
|
@@ -366,6 +367,21 @@ function registerTodoHandlers(manager) {
|
|
|
366
367
|
});
|
|
367
368
|
}
|
|
368
369
|
|
|
370
|
+
const obj = (value) => value && typeof value === "object" ? value : {};
|
|
371
|
+
async function guarded(fn) {
|
|
372
|
+
try {
|
|
373
|
+
return await fn();
|
|
374
|
+
} catch (error) {
|
|
375
|
+
if (error instanceof mirrorProtocol.ModelConfigError) return { error: error.message, code: error.code };
|
|
376
|
+
return { error: error instanceof Error ? error.message : "Unknown error", code: "internal" };
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
function registerModelConfigHandlers(rpc, service) {
|
|
380
|
+
rpc.registerHandler("model-config-read", (params) => guarded(() => service.read(obj(params))));
|
|
381
|
+
rpc.registerHandler("model-config-apply", (params) => guarded(() => service.apply(obj(params))));
|
|
382
|
+
rpc.registerHandler("model-config-restore", (params) => guarded(() => service.restore(obj(params))));
|
|
383
|
+
}
|
|
384
|
+
|
|
369
385
|
function codingAgentFromProcessTree(panePid, snapshot) {
|
|
370
386
|
const rows = snapshot.split("\n").flatMap((line) => {
|
|
371
387
|
const m = line.trim().match(/^(\d+)\s+(\d+)\s+(.+)$/);
|
|
@@ -10489,6 +10505,9 @@ class ApiMachineClient {
|
|
|
10489
10505
|
claudeAuthState = null;
|
|
10490
10506
|
/** B-587: the machine's hibernation threshold, published as a capability. */
|
|
10491
10507
|
agentHibernationIdleMs = null;
|
|
10508
|
+
/** B-510: last normalized `webPanels` (null = never set → field not written). */
|
|
10509
|
+
webPanels = null;
|
|
10510
|
+
webPanelsSignatureSent = null;
|
|
10492
10511
|
rateLimitPushChain = Promise.resolve();
|
|
10493
10512
|
rateLimitPublisher = new RateLimitPublisher({
|
|
10494
10513
|
getCurrent: () => this.machine.daemonState?.rateLimits,
|
|
@@ -10668,6 +10687,27 @@ class ApiMachineClient {
|
|
|
10668
10687
|
return { agentHibernation: { idleMs } };
|
|
10669
10688
|
});
|
|
10670
10689
|
}
|
|
10690
|
+
/**
|
|
10691
|
+
* B-510: mirror the local `webPanels` declaration into daemonState. Every
|
|
10692
|
+
* daemonState write is a CAS + DB write + broadcast, so an unchanged list
|
|
10693
|
+
* (same signature as the last one sent) writes nothing.
|
|
10694
|
+
*/
|
|
10695
|
+
setWebPanels(panels) {
|
|
10696
|
+
this.webPanels = panels;
|
|
10697
|
+
const signature = webPanels.webPanelsSignature(panels);
|
|
10698
|
+
if (signature === this.webPanelsSignatureSent || !this.socket?.connected) return Promise.resolve();
|
|
10699
|
+
const attempt = this.cliUpdatePushChain.then(() => this.updateDaemonState((current) => ({
|
|
10700
|
+
...current ?? {},
|
|
10701
|
+
status: current?.status ?? "running",
|
|
10702
|
+
webPanels: { panels, updatedAt: Date.now() }
|
|
10703
|
+
}))).then(() => {
|
|
10704
|
+
this.webPanelsSignatureSent = signature;
|
|
10705
|
+
}).catch((error) => {
|
|
10706
|
+
logger.logger.debug("[API MACHINE] Failed to publish web panels:", error);
|
|
10707
|
+
});
|
|
10708
|
+
this.cliUpdatePushChain = attempt.then(() => void 0);
|
|
10709
|
+
return attempt;
|
|
10710
|
+
}
|
|
10671
10711
|
publishAgentHibernation() {
|
|
10672
10712
|
const idleMs = this.agentHibernationIdleMs;
|
|
10673
10713
|
if (idleMs === null || !this.socket?.connected) return Promise.resolve();
|
|
@@ -10698,6 +10738,10 @@ class ApiMachineClient {
|
|
|
10698
10738
|
return { claudeAuth };
|
|
10699
10739
|
});
|
|
10700
10740
|
}
|
|
10741
|
+
/** B-688 machine RPCs `model-config-*` (modules/modelConfig/modelConfigRpc.ts). */
|
|
10742
|
+
setModelConfigService(service) {
|
|
10743
|
+
registerModelConfigHandlers(this.rpcHandlerManager, service);
|
|
10744
|
+
}
|
|
10701
10745
|
/**
|
|
10702
10746
|
* B-506: the five `sessions.*` methods a CLI on ANOTHER machine of this
|
|
10703
10747
|
* account calls to read / message sessions this daemon spawned. Plaintext
|
|
@@ -11402,9 +11446,12 @@ class ApiMachineClient {
|
|
|
11402
11446
|
// leaves a stale-pid value visible longer than needed.
|
|
11403
11447
|
...this.claudeAuthState ? { claudeAuth: this.claudeAuthState } : {},
|
|
11404
11448
|
// B-587 capability + setting (same restamp discipline).
|
|
11405
|
-
...this.agentHibernationIdleMs !== null ? { agentHibernation: { idleMs: this.agentHibernationIdleMs, rpcAvailable: true, detectedAt: now } } : {}
|
|
11449
|
+
...this.agentHibernationIdleMs !== null ? { agentHibernation: { idleMs: this.agentHibernationIdleMs, rpcAvailable: true, detectedAt: now } } : {},
|
|
11450
|
+
// B-510: re-ship the declared panels (also clears a stale list).
|
|
11451
|
+
...Array.isArray(this.webPanels) ? { webPanels: { panels: this.webPanels, updatedAt: now } } : {}
|
|
11406
11452
|
};
|
|
11407
11453
|
});
|
|
11454
|
+
if (Array.isArray(this.webPanels)) this.webPanelsSignatureSent = webPanels.webPanelsSignature(this.webPanels);
|
|
11408
11455
|
this.webTerminal.startListTracking((terminals) => this.pushTerminalList(terminals));
|
|
11409
11456
|
if (!rpcAlreadyRegistered) this.rpcHandlerManager.onSocketConnect(socket);
|
|
11410
11457
|
this.syncResumeSessionRpcRegistration();
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
4
|
var promises = require('node:fs/promises');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var
|
|
7
|
-
var configuration = require('./configuration-
|
|
6
|
+
var pushNotifications = require('./pushNotifications-DI92havG.cjs');
|
|
7
|
+
var configuration = require('./configuration-CYO-kPOS.cjs');
|
|
8
8
|
|
|
9
9
|
const CLAUDE_ATTACHMENT_KINDS = [
|
|
10
10
|
"image/jpeg",
|
|
@@ -34,8 +34,8 @@ async function stageClaudeAttachments(attachments, options) {
|
|
|
34
34
|
await configuration.ensurePrivateDirectory(sessionDir);
|
|
35
35
|
const staged = [];
|
|
36
36
|
for (const attachment of attachments) {
|
|
37
|
-
if (attachment.data.length >
|
|
38
|
-
throw new Error(`Attachment exceeds the ${
|
|
37
|
+
if (attachment.data.length > pushNotifications.MAX_CHAT_ATTACHMENT_SOURCE_BYTES) {
|
|
38
|
+
throw new Error(`Attachment exceeds the ${pushNotifications.MAX_CHAT_ATTACHMENT_SOURCE_BYTES / 1024 / 1024} MB limit`);
|
|
39
39
|
}
|
|
40
40
|
const name = safeFileName(attachment.name || "file");
|
|
41
41
|
const targetPath = path.join(sessionDir, uniqueFileName(name));
|