very-happy-cli 0.2.195 → 0.2.197
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-BTIF87yb.mjs → AcpBackend-B-CD1MrV.mjs} +3 -3
- package/dist/{AcpBackend-CXSV6FF5.cjs → AcpBackend-CqDg1GgF.cjs} +3 -3
- package/dist/{AcpSessionManager-CEpU_GVk.mjs → AcpSessionManager-CgomFAjk.mjs} +2 -2
- package/dist/{AcpSessionManager-BbWODxSp.cjs → AcpSessionManager-Cv1KTldV.cjs} +1 -1
- package/dist/{BasePermissionHandler-C6iF28Ct.cjs → BasePermissionHandler-BxUjjHiI.cjs} +1 -1
- package/dist/{BasePermissionHandler-B5ka7Aaf.mjs → BasePermissionHandler-D6-fZvtx.mjs} +1 -1
- package/dist/{account-Bvcdk9CH.cjs → account-Bexqa-vj.cjs} +5 -5
- package/dist/{account-WSJcdMGl.mjs → account-CnN-iHFd.mjs} +11 -11
- package/dist/{accountService-BtEgv0fC.mjs → accountService-DQ21IlBs.mjs} +4 -4
- package/dist/{acpSessionResume-B2hd1Wub.cjs → acpSessionResume-CfEw8L26.cjs} +1 -1
- package/dist/{acpSessionResume-BYMm4w8Q.mjs → acpSessionResume-DzFELzTU.mjs} +1 -1
- package/dist/{agentHome-CVM15_3U.cjs → agentHome-CBYL4J4Q.cjs} +4 -4
- package/dist/{agentHome-Jl8yWAjF.mjs → agentHome-CmSA7hBC.mjs} +4 -4
- package/dist/{api-TpjZJXV-.cjs → api-CB3tLbbj.cjs} +45 -12
- package/dist/{api-DOzNOoVJ.mjs → api-Do7MUIrP.mjs} +46 -13
- package/dist/{apiMachine-M-Fs9g5Y.mjs → apiMachine-CytFlPdl.mjs} +101 -30
- package/dist/{apiMachine-COkvJAmd.cjs → apiMachine-guUGAifI.cjs} +96 -25
- package/dist/{attachmentContent-D6PjMVDq.mjs → attachmentContent-B8Lg7kgp.mjs} +2 -2
- package/dist/{attachmentContent-BiBOjTXX.cjs → attachmentContent-errR84kh.cjs} +2 -2
- package/dist/{auth-BfHLe1gU.mjs → auth-B-1T6w1U.mjs} +8 -8
- package/dist/{auth-BOceB8cL.cjs → auth-BhM0lHLA.cjs} +8 -8
- package/dist/{auth-Bfe3Ue_B.mjs → auth-Dnu0Mocz.mjs} +5 -5
- package/dist/{auth-DfcdjMUp.cjs → auth-ZKJNs8AK.cjs} +5 -5
- package/dist/{auto-CDeivd5V.mjs → auto-CFSmWudH.mjs} +17 -17
- package/dist/{auto-CnTitokD.cjs → auto-eimPZ4gm.cjs} +14 -14
- package/dist/{bootstrap-DpyP22Wx.cjs → bootstrap-B7mwfud6.cjs} +2 -2
- package/dist/{bootstrap-BxcKrgR9.mjs → bootstrap-C2JyiPax.mjs} +2 -2
- package/dist/{browser-ac0aPrVE.cjs → browser-B3VVAWcC.cjs} +1 -1
- package/dist/{browser-Bb0Gqffc.mjs → browser-Cnk2N81e.mjs} +1 -1
- package/dist/{claudeAccountEnv-NyoxjLuJ.mjs → claudeAccountEnv-CPO6CGNd.mjs} +1 -1
- package/dist/{claudeLocal-RGWhplSr.cjs → claudeLocal-CvZ5Sfq_.cjs} +4 -4
- package/dist/{claudeLocal-otwxWF6e.mjs → claudeLocal-gDpGeteK.mjs} +5 -5
- package/dist/{claudeLocalLauncher-yG-MBhY7.cjs → claudeLocalLauncher-CFSxFln_.cjs} +9 -9
- package/dist/{claudeLocalLauncher-CTibA4cU.mjs → claudeLocalLauncher-e_DkguJW.mjs} +10 -10
- package/dist/{claudeSessionFork-DH_Su4uO.cjs → claudeSessionFork--_RtwhC2.cjs} +1 -1
- package/dist/{claudeSessionFork-HFFwivGY.mjs → claudeSessionFork-BMMJmfxX.mjs} +1 -1
- package/dist/{client-BhAjEv8Z.mjs → client-Bav5WI8p.mjs} +4 -4
- package/dist/{client-DpTk1S7C.mjs → client-BeEAF2yn.mjs} +2 -2
- package/dist/{client-CydHzidF.mjs → client-CkiWUkm6.mjs} +2 -2
- package/dist/{client-BlV73Gbw.cjs → client-DH_mgm2T.cjs} +2 -2
- package/dist/{client-DcXLNaF2.cjs → client-DmO89_dS.cjs} +2 -2
- package/dist/{client-DxjYsJ8d.cjs → client-TZ1BY7kn.cjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +15 -15
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAccount-CKXpXq0B.mjs → codexAccount-iZwmpYti.mjs} +1 -1
- package/dist/{codexAppServerClient-mln0W8vT.mjs → codexAppServerClient-AcMiUjlK.mjs} +3 -3
- package/dist/{codexAppServerClient-C1xBSuVk.cjs → codexAppServerClient-C4FYS9D9.cjs} +3 -3
- package/dist/{codexCommand-Plm-_aRy.cjs → codexCommand-BkF16_aL.cjs} +50 -45
- package/dist/{codexCommand-CmWhYduF.mjs → codexCommand-CuteJvKE.mjs} +56 -51
- package/dist/{codexTermination-QltAvFpq.mjs → codexTermination-CjHWp1C_.mjs} +6 -2
- package/dist/{codexTermination-C9c80lIF.cjs → codexTermination-DGgKsMxj.cjs} +6 -2
- package/dist/{config-BH75enfT.cjs → config-BklFo_Cs.cjs} +3 -3
- package/dist/{config-DK27kWTT.mjs → config-CUvb7oaW.mjs} +3 -3
- package/dist/{configuration-CwfgJZKs.mjs → configuration-BIh6P6kB.mjs} +1 -1
- package/dist/{configuration-CKaq0tNe.cjs → configuration-BL_fxboH.cjs} +1 -1
- package/dist/{connect-_QkCFMxO.cjs → connect-Bi7cRXtj.cjs} +14 -14
- package/dist/{connect-h3_VMJst.mjs → connect-KIJsx0iT.mjs} +15 -15
- package/dist/{context-DbENnaVc.cjs → context-BYcZIvKn.cjs} +1 -1
- package/dist/{context-DcOpvIiR.mjs → context-Ct__7RAS.mjs} +1 -1
- package/dist/{controlClient-Dv6IvvUq.mjs → controlClient-CPZkMKsH.mjs} +19 -7
- package/dist/{controlClient-D_HIbnnS.cjs → controlClient-DMtkGpc3.cjs} +19 -7
- package/dist/{createSessionMetadata-CusO22Am.cjs → createSessionMetadata-BWr0XT-Y.cjs} +2 -2
- package/dist/{createSessionMetadata-DimBsfVG.mjs → createSessionMetadata-DkkddlJa.mjs} +2 -2
- package/dist/{daemonAccounts-QT-RDDEp.mjs → daemonAccounts-CnAEaJE_.mjs} +3 -3
- package/dist/{defaultPermissionMode-B-Vt8ECY.mjs → defaultPermissionMode-CpEJ0wlb.mjs} +1 -1
- package/dist/{deterministicJson-BYqRKTmL.cjs → deterministicJson-BO6ZUUiV.cjs} +12 -12
- package/dist/{deterministicJson-CMApF2Rl.mjs → deterministicJson-Dm3yDrwj.mjs} +13 -13
- package/dist/{doctor-u46qYYKX.cjs → doctor-CJpFhHoK.cjs} +8 -9
- package/dist/{doctor-Czbl7gk2.cjs → doctor-DHK-5Hxm.cjs} +8 -8
- package/dist/{doctor-BPkYWSuq.mjs → doctor-GN5mPOn5.mjs} +8 -9
- package/dist/{doctor-BkyoZ0Uw.mjs → doctor-TK49jR60.mjs} +8 -8
- package/dist/{downloadTarget-CM0BZNSY.mjs → downloadTarget-C2XcfMXb.mjs} +7 -7
- package/dist/{downloadTarget-C5BzZ_bz.cjs → downloadTarget-QP5nnKsW.cjs} +7 -7
- package/dist/{ensureDaemonRunning-P399ot_C.mjs → ensureDaemonRunning-Bi-PF5LL.mjs} +5 -5
- package/dist/{ensureDaemonRunning-D508DmcP.cjs → ensureDaemonRunning-pg-EYmG0.cjs} +5 -5
- package/dist/{handleResumeCommand-BK_2ShBf.mjs → handleResumeCommand-B69L6W80.mjs} +5 -5
- package/dist/{handleResumeCommand-CCgK7-0v.cjs → handleResumeCommand-CMLpVjkl.cjs} +5 -5
- package/dist/{index-DR3NJLVk.mjs → index-BM14YD9K.mjs} +5 -5
- package/dist/{index-BENDk1i9.mjs → index-BSSAKD4Q.mjs} +4 -4
- package/dist/{index-BlWyEpMw.mjs → index-C27JFCbe.mjs} +1 -1
- package/dist/{index-_DRVKtSd.mjs → index-CwwDV02T.mjs} +55 -48
- package/dist/{index-BalJgriQ.cjs → index-DC_XlLAD.cjs} +5 -5
- package/dist/{index-Bz9Bj7l1.cjs → index-DgnbOqH_.cjs} +3 -3
- package/dist/{index-QSAckvNv.mjs → index-P6modcWo.mjs} +3 -3
- package/dist/{index-CGKn-GTK.cjs → index-XeWmi_Wt.cjs} +4 -4
- package/dist/{index-CSO1-mZ9.cjs → index-sXThJ-ic.cjs} +49 -42
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-DMTvEPrB.mjs → install-B6vD9h4Z.mjs} +3 -3
- package/dist/{install-CqXaN7_C.cjs → install-Cyb1ZsOO.cjs} +3 -3
- package/dist/lib.cjs +16 -16
- package/dist/lib.d.cts +13 -0
- package/dist/lib.d.mts +13 -0
- package/dist/lib.mjs +16 -16
- package/dist/{lidState-Btv4N_B8.cjs → lidState-DXy1ymL0.cjs} +1 -1
- package/dist/{lidState-Cb3TbhPb.mjs → lidState-nbXgabCS.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CAAIUJyY.mjs → localHappyAgentAuth-BupJnMMB.mjs} +1 -1
- package/dist/{localHappyAgentAuth-B3Q5DNLR.cjs → localHappyAgentAuth-Dxl6itKW.cjs} +1 -1
- package/dist/{logger-UgDpJA2u.mjs → logger-CahcyjlK.mjs} +2 -2
- package/dist/{logger-BZ5TcbEh.cjs → logger-CtweAuKq.cjs} +2 -2
- package/dist/{machineMetadata-BYHC-3Vx.mjs → machineMetadata-jOqz4fn8.mjs} +3 -3
- package/dist/{machineMetadata-DLb-m4fL.cjs → machineMetadata-thOCcaSv.cjs} +3 -3
- package/dist/{main-LavPb80B.cjs → main-CTIbEEsd.cjs} +48 -48
- package/dist/{main-CwW6lHIw.mjs → main-bCGlXj7y.mjs} +48 -48
- package/dist/{mcp-BQbWhqUh.cjs → mcp-BOS5msHd.cjs} +16 -16
- package/dist/{mcp-BjYz5Ymf.mjs → mcp-dtmpWc-Y.mjs} +20 -20
- package/dist/{mirrorProtocol-Ci9YmCEV.cjs → mirrorProtocol-CFDn3zfT.cjs} +11 -3
- package/dist/{mirrorProtocol-BH5eT99U.mjs → mirrorProtocol-OJPFNpbq.mjs} +12 -5
- package/dist/{package-C4OfB2YF.mjs → package-DUKnh8UF.mjs} +7 -7
- package/dist/{package-B61-BBlh.cjs → package-DdYN77UN.cjs} +7 -7
- package/dist/{panels-cBJT5Up1.mjs → panels-DQs5x77X.mjs} +5 -5
- package/dist/{panels-ByprLJag.cjs → panels-DZZTavkP.cjs} +5 -5
- package/dist/{peerTools-BXSjS8lB.cjs → peerTools-03MimWe-.cjs} +5 -5
- package/dist/{peerTools-DS6GqJcn.mjs → peerTools-ByJiL-w1.mjs} +5 -5
- package/dist/{persistence-CQhmtobL.mjs → persistence-CPIj3Iha.mjs} +15 -5
- package/dist/{persistence-DBmeYlwT.cjs → persistence-CWEaFv6R.cjs} +15 -5
- package/dist/{piRunnerArgs-CmEE058l.cjs → piRunnerArgs-Aqs-zKLm.cjs} +1 -1
- package/dist/{piRunnerArgs-Dy-3vN_Q.mjs → piRunnerArgs-DxbuKnFC.mjs} +1 -1
- package/dist/{piRuntime-BCXjC4__.cjs → piRuntime-BFMV2Hlg.cjs} +1 -1
- package/dist/{piRuntime-Rq9v4M4e.mjs → piRuntime-KJn9G3Ax.mjs} +1 -1
- package/dist/{piTerminal-ehNQOvLL.cjs → piTerminal-DFzQb38E.cjs} +18 -18
- package/dist/{piTerminal-CRhDUqX7.mjs → piTerminal-DhVFk2Hc.mjs} +22 -22
- package/dist/processTermination-ChJG5SLW.mjs +107 -0
- package/dist/processTermination-f17wxlMb.cjs +110 -0
- package/dist/{processTreeSnapshot-mDbnuojn.cjs → processTreeSnapshot-D5iNblp6.cjs} +26 -0
- package/dist/{processTreeSnapshot-CuLJDNC-.mjs → processTreeSnapshot-fuwxC0fr.mjs} +25 -1
- package/dist/{pushNotifications-qCS7_tDF.cjs → pushNotifications-BhnrQa32.cjs} +24 -2
- package/dist/{pushNotifications-67GmbVfE.mjs → pushNotifications-CD5-W90c.mjs} +24 -4
- package/dist/{query-CIDBGnv6.mjs → query-BRTHwQ1m.mjs} +2 -2
- package/dist/{query-B4QIiI7e.cjs → query-BRvDJTUF.cjs} +2 -2
- package/dist/{rateLimitWindows-8-khalzj.mjs → rateLimitWindows-BAfkXSck.mjs} +1 -1
- package/dist/{rateLimitWindows-BIfLMxOk.cjs → rateLimitWindows-_KfSDJdB.cjs} +1 -1
- package/dist/{registerCommonHandlers-C7hlztAO.mjs → registerCommonHandlers-Anq6Ma1d.mjs} +2 -2
- package/dist/{registerCommonHandlers-G2p0MJu4.cjs → registerCommonHandlers-CsMpXP1_.cjs} +2 -2
- package/dist/{registerKillSessionHandler-BWvl6wro.cjs → registerKillSessionHandler-DnES0UnY.cjs} +5 -5
- package/dist/{registerKillSessionHandler-rwXdO0t0.mjs → registerKillSessionHandler-DvA-f_D4.mjs} +6 -6
- package/dist/{registerSideQuestionHandler-Xg46gSVh.mjs → registerSideQuestionHandler-B6EgCzBZ.mjs} +4 -4
- package/dist/{registerSideQuestionHandler-CsyPnjce.cjs → registerSideQuestionHandler-GIzcFczo.cjs} +4 -4
- package/dist/{remoteSessionClient-D6_7vNKc.cjs → remoteSessionClient-BsXgrMSP.cjs} +5 -5
- package/dist/{remoteSessionClient-DQSnC7ox.mjs → remoteSessionClient-DYTwJSZR.mjs} +5 -5
- package/dist/{reportProgressTool-CIHGKraF.cjs → reportProgressTool-DhTM7qvk.cjs} +2 -2
- package/dist/{reportProgressTool-HjzV5y_2.mjs → reportProgressTool-DzmnFItq.mjs} +3 -3
- package/dist/{run-M06F1958.mjs → run-Cuz34V0P.mjs} +53 -73
- package/dist/{run-tQ4bFkHu.cjs → run-D0nDSvGo.cjs} +47 -67
- package/dist/{runClaude-Ct0_mShC.cjs → runClaude-DHHDBtKG.cjs} +29 -25
- package/dist/{runClaude-Dm9kQZ-w.mjs → runClaude-ySgHmPJg.mjs} +34 -30
- package/dist/{runClaudeDeps-BT2kWCrQ.cjs → runClaudeDeps-Cfeci4al.cjs} +41 -40
- package/dist/{runClaudeDeps-DNOzXjc3.mjs → runClaudeDeps-k-QAN7Em.mjs} +53 -52
- package/dist/{runGemini-BvN-yeQR.mjs → runGemini-BpiHwTGj.mjs} +39 -36
- package/dist/{runGemini-cua7_iuR.cjs → runGemini-Dob7MFa2.cjs} +38 -35
- package/dist/{runOpenClaw-NpYFRhKm.cjs → runOpenClaw-B-BGCcbD.cjs} +30 -20
- package/dist/{runOpenClaw-C9E2XzmX.mjs → runOpenClaw-B_7LblMr.mjs} +30 -20
- package/dist/{sandbox-C-BXZbt9.mjs → sandbox-D4UmUYIM.mjs} +4 -4
- package/dist/{sandbox-hImfD0-T.cjs → sandbox-D9xs3oeT.cjs} +4 -4
- package/dist/{selfCheck-B3ulijQM.cjs → selfCheck-B1ueapb2.cjs} +39 -39
- package/dist/selfCheck-BrC9vuGH.mjs +88 -0
- package/dist/{send-Dv2L8IRW.mjs → send-BZoS0m6-.mjs} +8 -8
- package/dist/{send-BCVQkTOl.cjs → send-CgIeqwqq.cjs} +8 -8
- package/dist/{server-BBBfuSB-.mjs → server-C5zdUyIu.mjs} +4 -4
- package/dist/{server-DYxyCyYF.cjs → server-XgEG5D8c.cjs} +6 -6
- package/dist/{sessionExitLifecycle-DFltxXU8.cjs → sessionExitLifecycle-DB2rjvVS.cjs} +5 -1
- package/dist/{sessionExitLifecycle-CzkLIgNZ.mjs → sessionExitLifecycle-iAtZN9sa.mjs} +5 -1
- package/dist/{sessionLock-BexUoWhZ.mjs → sessionLock-C4zRSYwt.mjs} +94 -78
- package/dist/{sessionLock-B8fsnpZD.cjs → sessionLock-CbIB9WAp.cjs} +92 -78
- package/dist/{sessionOps-74pSDXoS.cjs → sessionOps-flaRRzdo.cjs} +4 -4
- package/dist/{sessionOps-BkEgNA2O.mjs → sessionOps-fuLJNyOT.mjs} +4 -4
- package/dist/{sessionProvider-DXkhlJE6.mjs → sessionProvider-DPwRzcbT.mjs} +10 -10
- package/dist/{sessionProvider-CWgHsZUA.cjs → sessionProvider-DlWrak_l.cjs} +5 -5
- package/dist/{sessionScanner-Dhh1wREW.mjs → sessionScanner-BX7ZBVzX.mjs} +3 -3
- package/dist/{sessionScanner-D56EkcIj.cjs → sessionScanner-I6fGycPd.cjs} +3 -3
- package/dist/{sessions-C1zRTjUe.cjs → sessions-Cr0jIQ9r.cjs} +10 -10
- package/dist/{sessions-dJR6k3JY.mjs → sessions-Csz0_dnz.mjs} +10 -10
- package/dist/{setupOfflineReconnection-CMUdHtFT.cjs → setupOfflineReconnection-BawiOCUA.cjs} +2 -2
- package/dist/{setupOfflineReconnection-Dp1rC-eP.mjs → setupOfflineReconnection-Pxsr7M_B.mjs} +2 -2
- package/dist/{spawn-kMKI09Kh.cjs → spawn-Bfw10V7R.cjs} +12 -12
- package/dist/{spawn-D3-Weoiq.mjs → spawn-C3wiREei.mjs} +14 -14
- package/dist/{spawnAgents-hKFGQaSJ.mjs → spawnAgents-N3jxdNJC.mjs} +1 -1
- package/dist/{spawnHappyCLI-CgjpjSTT.mjs → spawnHappyCLI-C9dzdAh0.mjs} +1 -1
- package/dist/{spawnHappyCLI-Du1IgJGA.cjs → spawnHappyCLI-D4_Ij_BB.cjs} +1 -1
- package/dist/{startFileWatcher-DGOnF95-.cjs → startFileWatcher-905w_JCn.cjs} +1 -1
- package/dist/{startFileWatcher-DapvIGxp.mjs → startFileWatcher-FjvRihwq.mjs} +1 -1
- package/dist/{startupSessionCreate-CSi60oo_.mjs → startupSessionCreate-B-QHA-nQ.mjs} +3 -3
- package/dist/{startupSessionCreate-rkIMVGJW.cjs → startupSessionCreate-WY7c74aG.cjs} +3 -3
- package/dist/{store-Tf-r1ouq.mjs → store-BlPvTr_Q.mjs} +1 -1
- package/dist/{streamRelay-C9lzMo0V.mjs → streamRelay-DFZyAPD_.mjs} +1 -1
- package/dist/{sync-GJkf-HGu.mjs → sync-CHU9HM9N.mjs} +1 -1
- package/dist/{sync-Cj8Vhltg.cjs → sync-Dz_U1UHu.cjs} +1 -1
- package/dist/{systemPrompt-Cne9i1SE.cjs → systemPrompt-NTIxM2Ss.cjs} +1 -1
- package/dist/{systemPrompt-BEagRbDZ.mjs → systemPrompt-PHD2Va2G.mjs} +2 -2
- package/dist/{teams-C_18IMNM.mjs → teams-CgT1c65s.mjs} +7 -7
- package/dist/{teams-ClTg6hQ1.cjs → teams-CqoSWbrQ.cjs} +6 -6
- package/dist/{template-Ci-cyigF.mjs → template-CJ8uLlD8.mjs} +1 -1
- package/dist/{terminals-Dlg0x3nY.mjs → terminals-Dc38XmZv.mjs} +9 -5
- package/dist/{terminals-B_bfC9c2.cjs → terminals-dK3Lrjfp.cjs} +9 -5
- package/dist/{time-BPPTQ_sE.cjs → time-BTXLicT9.cjs} +1 -1
- package/dist/{time-CIkdLyza.mjs → time-DZ7wPlsL.mjs} +1 -1
- package/dist/{titleGenerator-DnwTdTB_.mjs → titleGenerator-BOcHO0fW.mjs} +2 -2
- package/dist/{titleGenerator-B_OgL9Pd.cjs → titleGenerator-DxSLdXjL.cjs} +2 -2
- package/dist/tmuxSocket-BmZyixRM.mjs +29 -0
- package/dist/{tmuxSocket-D-Xt6Vn-.cjs → tmuxSocket-Dg11Olx0.cjs} +12 -0
- package/dist/{todo-DPQHtZVM.cjs → todo-CqD6H2Bt.cjs} +5 -5
- package/dist/{todo-DmHolFRy.mjs → todo-kBweG4H9.mjs} +6 -6
- package/dist/{tools-B3KGMSU5.cjs → tools-C7SRJVwy.cjs} +1 -1
- package/dist/{tools-DqjPHq9I.mjs → tools-DuXYIUTD.mjs} +1 -1
- package/dist/{uninstall-CrK5dgx8.cjs → uninstall-DHdOrwHT.cjs} +3 -3
- package/dist/{uninstall-Cm97eybp.mjs → uninstall-WJYYM27v.mjs} +3 -3
- package/dist/{wrapperAccount-Cq7eZRMx.mjs → wrapperAccount-RPtq8BwD.mjs} +2 -2
- package/package.json +7 -7
- package/dist/selfCheck-D-e9kVhc.mjs +0 -88
- package/dist/tmuxSocket-B8Yx20sT.mjs +0 -19
|
@@ -6,15 +6,15 @@ import { createRequire } from 'node:module';
|
|
|
6
6
|
import { randomBytes } from 'node:crypto';
|
|
7
7
|
import { spawn } from 'node:child_process';
|
|
8
8
|
import { createInterface } from 'node:readline/promises';
|
|
9
|
-
import { c as configuration } from './configuration-
|
|
10
|
-
import { u as updateSettings } from './persistence-
|
|
9
|
+
import { c as configuration } from './configuration-BIh6P6kB.mjs';
|
|
10
|
+
import { u as updateSettings } from './persistence-CPIj3Iha.mjs';
|
|
11
11
|
import 'node:os';
|
|
12
|
-
import './package-
|
|
12
|
+
import './package-DUKnh8UF.mjs';
|
|
13
13
|
import 'node:fs/promises';
|
|
14
14
|
import 'zod';
|
|
15
15
|
import './authRelay-DhQhkBvX.mjs';
|
|
16
16
|
import 'tweetnacl';
|
|
17
|
-
import './logger-
|
|
17
|
+
import './logger-CahcyjlK.mjs';
|
|
18
18
|
import 'node:util';
|
|
19
19
|
|
|
20
20
|
function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, generatedInviteCode) {
|
|
@@ -8,15 +8,15 @@ var module$1 = require('node:module');
|
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
9
9
|
var node_child_process = require('node:child_process');
|
|
10
10
|
var promises = require('node:readline/promises');
|
|
11
|
-
var configuration = require('./configuration-
|
|
12
|
-
var persistence = require('./persistence-
|
|
11
|
+
var configuration = require('./configuration-BL_fxboH.cjs');
|
|
12
|
+
var persistence = require('./persistence-CWEaFv6R.cjs');
|
|
13
13
|
require('node:os');
|
|
14
|
-
require('./package-
|
|
14
|
+
require('./package-DdYN77UN.cjs');
|
|
15
15
|
require('node:fs/promises');
|
|
16
16
|
require('zod');
|
|
17
17
|
require('./authRelay-Dy1qU9td.cjs');
|
|
18
18
|
require('tweetnacl');
|
|
19
|
-
require('./logger-
|
|
19
|
+
require('./logger-CtweAuKq.cjs');
|
|
20
20
|
require('node:util');
|
|
21
21
|
|
|
22
22
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
@@ -33,9 +33,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('server-
|
|
36
|
+
const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('server-XgEG5D8c.cjs', document.baseURI).href)));
|
|
37
37
|
const __dirname$1 = path.dirname(__filename$1);
|
|
38
|
-
const require_ = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('server-
|
|
38
|
+
const require_ = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('server-XgEG5D8c.cjs', document.baseURI).href)));
|
|
39
39
|
const PRISMA_QUERY_ENGINE_FILES = {
|
|
40
40
|
"arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
|
|
41
41
|
"x64-darwin": "libquery_engine-darwin.dylib.node",
|
|
@@ -72,6 +72,10 @@ class MessageBuffer {
|
|
|
72
72
|
|
|
73
73
|
const OFFLINE_EXIT_STAMP_TIMEOUT_MS = 3e3;
|
|
74
74
|
async function settleSessionOnExit(sessionId, intent, deps) {
|
|
75
|
+
if (intent === "superseded") {
|
|
76
|
+
deps.log?.(`[START] ${sessionId} superseded by a newer wrapper: leaving its lifecycle untouched`);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
75
79
|
if (intent === "archive") {
|
|
76
80
|
deps.updateMetadata((currentMetadata) => ({
|
|
77
81
|
...currentMetadata,
|
|
@@ -107,7 +111,7 @@ class SessionExitGate {
|
|
|
107
111
|
/** Returns the intent to act on, or null when cleanup already started. */
|
|
108
112
|
claim(intent) {
|
|
109
113
|
if (this.decided === "hibernate" && !this.hibernateCommitted && intent !== "hibernate") {
|
|
110
|
-
if (this.deferred !== "archive") this.deferred = intent;
|
|
114
|
+
if (this.deferred !== "superseded" && (this.deferred !== "archive" || intent === "superseded")) this.deferred = intent;
|
|
111
115
|
return null;
|
|
112
116
|
}
|
|
113
117
|
if (this.decided !== null) return null;
|
|
@@ -70,6 +70,10 @@ class MessageBuffer {
|
|
|
70
70
|
|
|
71
71
|
const OFFLINE_EXIT_STAMP_TIMEOUT_MS = 3e3;
|
|
72
72
|
async function settleSessionOnExit(sessionId, intent, deps) {
|
|
73
|
+
if (intent === "superseded") {
|
|
74
|
+
deps.log?.(`[START] ${sessionId} superseded by a newer wrapper: leaving its lifecycle untouched`);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
73
77
|
if (intent === "archive") {
|
|
74
78
|
deps.updateMetadata((currentMetadata) => ({
|
|
75
79
|
...currentMetadata,
|
|
@@ -105,7 +109,7 @@ class SessionExitGate {
|
|
|
105
109
|
/** Returns the intent to act on, or null when cleanup already started. */
|
|
106
110
|
claim(intent) {
|
|
107
111
|
if (this.decided === "hibernate" && !this.hibernateCommitted && intent !== "hibernate") {
|
|
108
|
-
if (this.deferred !== "archive") this.deferred = intent;
|
|
112
|
+
if (this.deferred !== "superseded" && (this.deferred !== "archive" || intent === "superseded")) this.deferred = intent;
|
|
109
113
|
return null;
|
|
110
114
|
}
|
|
111
115
|
if (this.decided !== null) return null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { o as hibernationReplaySeq } from './persistence-
|
|
1
|
+
import { o as hibernationReplaySeq } from './persistence-CPIj3Iha.mjs';
|
|
2
2
|
import { c as compareExactVersions } from './cliUpdate-Y34VGe9Y.mjs';
|
|
3
|
-
import { existsSync, readFileSync, unlinkSync, mkdirSync, renameSync } from 'node:fs';
|
|
3
|
+
import { existsSync, readFileSync, unlinkSync, mkdirSync, openSync, writeSync, closeSync, renameSync } from 'node:fs';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
|
-
import { c as configuration, w as writePrivateFileSync } from './configuration-
|
|
6
|
-
import { l as logger } from './logger-
|
|
7
|
-
import {
|
|
5
|
+
import { c as configuration, w as writePrivateFileSync } from './configuration-BIh6P6kB.mjs';
|
|
6
|
+
import { l as logger } from './logger-CahcyjlK.mjs';
|
|
7
|
+
import { t as terminateProcessTree, i as isProcessAlive } from './processTermination-ChJG5SLW.mjs';
|
|
8
8
|
|
|
9
9
|
const PROCESS_IDENTITY_FIELDS = [
|
|
10
10
|
"hostPid",
|
|
@@ -204,69 +204,15 @@ function takeAutoRestartedEvent(env, agentName) {
|
|
|
204
204
|
return { type: "message", kind: AUTO_UPDATED_EVENT_KIND, message: autoUpdatedEventText(decoded.kind, decoded.target, agentName) };
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
const runtime = {
|
|
208
|
-
signal: (pid, signal) => process.kill(pid, signal),
|
|
209
|
-
isAlive: (pid) => {
|
|
210
|
-
try {
|
|
211
|
-
process.kill(pid, 0);
|
|
212
|
-
return true;
|
|
213
|
-
} catch {
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
},
|
|
217
|
-
schedule: (callback, delayMs) => {
|
|
218
|
-
setTimeout(callback, delayMs);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
function terminateProcess(pid, onSettled, impl = runtime, graceMs = 2e3) {
|
|
222
|
-
if (!impl.isAlive(pid)) {
|
|
223
|
-
onSettled(true);
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
try {
|
|
227
|
-
impl.signal(pid, "SIGTERM");
|
|
228
|
-
} catch {
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
impl.schedule(() => {
|
|
232
|
-
if (impl.isAlive(pid)) {
|
|
233
|
-
try {
|
|
234
|
-
impl.signal(pid, "SIGKILL");
|
|
235
|
-
} catch {
|
|
236
|
-
onSettled(!impl.isAlive(pid));
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
impl.schedule(() => onSettled(!impl.isAlive(pid)), 100);
|
|
241
|
-
}, graceMs);
|
|
242
|
-
return true;
|
|
243
|
-
}
|
|
244
|
-
function terminateProcessTree(pid, onSettled, deps = {}) {
|
|
245
|
-
const snapshot = (deps.snapshot ?? ((root) => snapshotTree(root)))(pid);
|
|
246
|
-
const reap = deps.reap ?? ((entries) => killSurvivors(entries));
|
|
247
|
-
return (deps.terminate ?? terminateProcess)(pid, (stopped) => {
|
|
248
|
-
try {
|
|
249
|
-
reap(snapshot);
|
|
250
|
-
} catch {
|
|
251
|
-
}
|
|
252
|
-
onSettled(stopped);
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
|
|
256
207
|
const SESSION_LOCK_DIR = "session-locks";
|
|
208
|
+
const SESSION_CLAIM_WAIT_MS = 15e3;
|
|
209
|
+
const SESSION_CLAIM_POLL_MS = 100;
|
|
257
210
|
const defaultRuntime = () => ({
|
|
258
211
|
dir: join(configuration.happyHomeDir, SESSION_LOCK_DIR),
|
|
259
212
|
selfPid: process.pid,
|
|
260
213
|
now: () => Date.now(),
|
|
261
214
|
signal: (pid, signal) => process.kill(pid, signal),
|
|
262
|
-
isAlive: (pid) =>
|
|
263
|
-
try {
|
|
264
|
-
process.kill(pid, 0);
|
|
265
|
-
return true;
|
|
266
|
-
} catch {
|
|
267
|
-
return false;
|
|
268
|
-
}
|
|
269
|
-
},
|
|
215
|
+
isAlive: (pid) => isProcessAlive(pid),
|
|
270
216
|
schedule: (callback, delayMs) => {
|
|
271
217
|
setTimeout(callback, delayMs);
|
|
272
218
|
}
|
|
@@ -302,6 +248,52 @@ function writeSessionLock(happySessionId, record, dir) {
|
|
|
302
248
|
writePrivateFileSync(tmp, JSON.stringify(record));
|
|
303
249
|
renameSync(tmp, path);
|
|
304
250
|
}
|
|
251
|
+
function claimPath(happySessionId, dir) {
|
|
252
|
+
return `${sessionLockPath(happySessionId, dir)}.claim`;
|
|
253
|
+
}
|
|
254
|
+
function claimantPid(path) {
|
|
255
|
+
try {
|
|
256
|
+
const pid = Number.parseInt(readFileSync(path, "utf-8").trim(), 10);
|
|
257
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
258
|
+
} catch {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function tryTakeClaim(happySessionId, runtime) {
|
|
263
|
+
mkdirSync(runtime.dir, { recursive: true, mode: 448 });
|
|
264
|
+
const path = claimPath(happySessionId, runtime.dir);
|
|
265
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
266
|
+
try {
|
|
267
|
+
const fd = openSync(path, "wx", 384);
|
|
268
|
+
try {
|
|
269
|
+
writeSync(fd, String(runtime.selfPid));
|
|
270
|
+
} finally {
|
|
271
|
+
closeSync(fd);
|
|
272
|
+
}
|
|
273
|
+
return { taken: true };
|
|
274
|
+
} catch (error) {
|
|
275
|
+
if (error?.code !== "EEXIST") {
|
|
276
|
+
return { taken: true };
|
|
277
|
+
}
|
|
278
|
+
const pid2 = claimantPid(path);
|
|
279
|
+
if (pid2 !== null && pid2 !== runtime.selfPid && runtime.isAlive(pid2)) return { taken: false, claimant: pid2 };
|
|
280
|
+
try {
|
|
281
|
+
unlinkSync(path);
|
|
282
|
+
} catch {
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const pid = claimantPid(path);
|
|
287
|
+
return pid !== null && pid !== runtime.selfPid ? { taken: false, claimant: pid } : { taken: true };
|
|
288
|
+
}
|
|
289
|
+
function releaseClaim(happySessionId, runtime) {
|
|
290
|
+
const path = claimPath(happySessionId, runtime.dir);
|
|
291
|
+
if (claimantPid(path) !== runtime.selfPid) return;
|
|
292
|
+
try {
|
|
293
|
+
unlinkSync(path);
|
|
294
|
+
} catch {
|
|
295
|
+
}
|
|
296
|
+
}
|
|
305
297
|
function acquireSessionLock(happySessionId, options, runtime = defaultRuntime()) {
|
|
306
298
|
const record = () => ({
|
|
307
299
|
pid: runtime.selfPid,
|
|
@@ -309,24 +301,48 @@ function acquireSessionLock(happySessionId, options, runtime = defaultRuntime())
|
|
|
309
301
|
version: options.version,
|
|
310
302
|
...options.flavor ? { flavor: options.flavor } : {}
|
|
311
303
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
304
|
+
return new Promise((settle) => {
|
|
305
|
+
const deadline = runtime.now() + (options.claimWaitMs ?? SESSION_CLAIM_WAIT_MS);
|
|
306
|
+
const attempt = () => {
|
|
307
|
+
const claim = tryTakeClaim(happySessionId, runtime);
|
|
308
|
+
if (!claim.taken) {
|
|
309
|
+
if (runtime.now() >= deadline) {
|
|
310
|
+
settle({ ok: false, holder: { pid: claim.claimant, startedAt: 0, version: "" } });
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
runtime.schedule(attempt, SESSION_CLAIM_POLL_MS);
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const resolve = (result) => {
|
|
317
|
+
releaseClaim(happySessionId, runtime);
|
|
318
|
+
settle(result);
|
|
319
|
+
};
|
|
320
|
+
const holder = liveSessionLockHolder(happySessionId, runtime);
|
|
321
|
+
if (!holder) {
|
|
322
|
+
writeSessionLock(happySessionId, record(), runtime.dir);
|
|
323
|
+
resolve({ ok: true, replaced: null });
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
if (!options.takeover) {
|
|
323
327
|
resolve({ ok: false, holder });
|
|
324
328
|
return;
|
|
325
329
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
+
const requested = terminateProcessTree(holder.pid, (stopped) => {
|
|
331
|
+
if (!stopped) {
|
|
332
|
+
resolve({ ok: false, holder });
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
writeSessionLock(happySessionId, record(), runtime.dir);
|
|
336
|
+
resolve({ ok: true, replaced: holder });
|
|
337
|
+
}, {
|
|
338
|
+
...runtime.tree,
|
|
339
|
+
runtime,
|
|
340
|
+
graceMs: options.graceMs ?? 2e3,
|
|
341
|
+
onLeftovers: (pids) => logger.debug(`[SESSION LOCK] ${happySessionId}: takeover of ${holder.pid} left ${pids.join(", ")} running`)
|
|
342
|
+
});
|
|
343
|
+
if (!requested) resolve({ ok: false, holder });
|
|
344
|
+
};
|
|
345
|
+
attempt();
|
|
330
346
|
});
|
|
331
347
|
}
|
|
332
348
|
function releaseSessionLock(happySessionId, runtime = defaultRuntime()) {
|
|
@@ -356,4 +372,4 @@ async function claimSessionOrExit(happySessionId, options) {
|
|
|
356
372
|
process.on("exit", () => releaseSessionLock(happySessionId));
|
|
357
373
|
}
|
|
358
374
|
|
|
359
|
-
export { AUTO_RESTART_CAPABILITY as A, applyServerSnapshot as a, applyReconnectReplay as b, claimSessionOrExit as c, wrapperReportsIdle as d, exitCursorStamp as e, decideAutoRestart as f, autoRestartNextCheck as g, wrapperStaleness as h, AUTO_RESTART_MAX_ATTEMPTS as i, AUTO_RESTART_MIN_GAP_MS as j, readSessionLock as k,
|
|
375
|
+
export { AUTO_RESTART_CAPABILITY as A, applyServerSnapshot as a, applyReconnectReplay as b, claimSessionOrExit as c, wrapperReportsIdle as d, exitCursorStamp as e, decideAutoRestart as f, autoRestartNextCheck as g, wrapperStaleness as h, AUTO_RESTART_MAX_ATTEMPTS as i, AUTO_RESTART_MIN_GAP_MS as j, readSessionLock as k, AUTO_RESTARTED_ENV as l, mergeReconnectMetadata as m, encodeAutoRestarted as n, pendingUpgradeVersion as o, processIdentityFields as p, resolveQuietMs as q, recordAttempt as r, statusFromVerdict as s, takeAutoRestartedEvent as t, AUTO_RESTART_RECHECK_CAP_MS as u, withoutServerSnapshot as w };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var persistence = require('./persistence-
|
|
3
|
+
var persistence = require('./persistence-CWEaFv6R.cjs');
|
|
4
4
|
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
5
5
|
var node_fs = require('node:fs');
|
|
6
6
|
var path = require('node:path');
|
|
7
|
-
var configuration = require('./configuration-
|
|
8
|
-
var logger = require('./logger-
|
|
9
|
-
var
|
|
7
|
+
var configuration = require('./configuration-BL_fxboH.cjs');
|
|
8
|
+
var logger = require('./logger-CtweAuKq.cjs');
|
|
9
|
+
var processTermination = require('./processTermination-f17wxlMb.cjs');
|
|
10
10
|
|
|
11
11
|
const PROCESS_IDENTITY_FIELDS = [
|
|
12
12
|
"hostPid",
|
|
@@ -206,69 +206,15 @@ function takeAutoRestartedEvent(env, agentName) {
|
|
|
206
206
|
return { type: "message", kind: AUTO_UPDATED_EVENT_KIND, message: autoUpdatedEventText(decoded.kind, decoded.target, agentName) };
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
const runtime = {
|
|
210
|
-
signal: (pid, signal) => process.kill(pid, signal),
|
|
211
|
-
isAlive: (pid) => {
|
|
212
|
-
try {
|
|
213
|
-
process.kill(pid, 0);
|
|
214
|
-
return true;
|
|
215
|
-
} catch {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
schedule: (callback, delayMs) => {
|
|
220
|
-
setTimeout(callback, delayMs);
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
function terminateProcess(pid, onSettled, impl = runtime, graceMs = 2e3) {
|
|
224
|
-
if (!impl.isAlive(pid)) {
|
|
225
|
-
onSettled(true);
|
|
226
|
-
return true;
|
|
227
|
-
}
|
|
228
|
-
try {
|
|
229
|
-
impl.signal(pid, "SIGTERM");
|
|
230
|
-
} catch {
|
|
231
|
-
return false;
|
|
232
|
-
}
|
|
233
|
-
impl.schedule(() => {
|
|
234
|
-
if (impl.isAlive(pid)) {
|
|
235
|
-
try {
|
|
236
|
-
impl.signal(pid, "SIGKILL");
|
|
237
|
-
} catch {
|
|
238
|
-
onSettled(!impl.isAlive(pid));
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
impl.schedule(() => onSettled(!impl.isAlive(pid)), 100);
|
|
243
|
-
}, graceMs);
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
function terminateProcessTree(pid, onSettled, deps = {}) {
|
|
247
|
-
const snapshot = (deps.snapshot ?? ((root) => processTreeSnapshot.snapshotTree(root)))(pid);
|
|
248
|
-
const reap = deps.reap ?? ((entries) => processTreeSnapshot.killSurvivors(entries));
|
|
249
|
-
return (deps.terminate ?? terminateProcess)(pid, (stopped) => {
|
|
250
|
-
try {
|
|
251
|
-
reap(snapshot);
|
|
252
|
-
} catch {
|
|
253
|
-
}
|
|
254
|
-
onSettled(stopped);
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
209
|
const SESSION_LOCK_DIR = "session-locks";
|
|
210
|
+
const SESSION_CLAIM_WAIT_MS = 15e3;
|
|
211
|
+
const SESSION_CLAIM_POLL_MS = 100;
|
|
259
212
|
const defaultRuntime = () => ({
|
|
260
213
|
dir: path.join(configuration.configuration.happyHomeDir, SESSION_LOCK_DIR),
|
|
261
214
|
selfPid: process.pid,
|
|
262
215
|
now: () => Date.now(),
|
|
263
216
|
signal: (pid, signal) => process.kill(pid, signal),
|
|
264
|
-
isAlive: (pid) =>
|
|
265
|
-
try {
|
|
266
|
-
process.kill(pid, 0);
|
|
267
|
-
return true;
|
|
268
|
-
} catch {
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
},
|
|
217
|
+
isAlive: (pid) => processTermination.isProcessAlive(pid),
|
|
272
218
|
schedule: (callback, delayMs) => {
|
|
273
219
|
setTimeout(callback, delayMs);
|
|
274
220
|
}
|
|
@@ -304,6 +250,52 @@ function writeSessionLock(happySessionId, record, dir) {
|
|
|
304
250
|
configuration.writePrivateFileSync(tmp, JSON.stringify(record));
|
|
305
251
|
node_fs.renameSync(tmp, path);
|
|
306
252
|
}
|
|
253
|
+
function claimPath(happySessionId, dir) {
|
|
254
|
+
return `${sessionLockPath(happySessionId, dir)}.claim`;
|
|
255
|
+
}
|
|
256
|
+
function claimantPid(path) {
|
|
257
|
+
try {
|
|
258
|
+
const pid = Number.parseInt(node_fs.readFileSync(path, "utf-8").trim(), 10);
|
|
259
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
260
|
+
} catch {
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
function tryTakeClaim(happySessionId, runtime) {
|
|
265
|
+
node_fs.mkdirSync(runtime.dir, { recursive: true, mode: 448 });
|
|
266
|
+
const path = claimPath(happySessionId, runtime.dir);
|
|
267
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
268
|
+
try {
|
|
269
|
+
const fd = node_fs.openSync(path, "wx", 384);
|
|
270
|
+
try {
|
|
271
|
+
node_fs.writeSync(fd, String(runtime.selfPid));
|
|
272
|
+
} finally {
|
|
273
|
+
node_fs.closeSync(fd);
|
|
274
|
+
}
|
|
275
|
+
return { taken: true };
|
|
276
|
+
} catch (error) {
|
|
277
|
+
if (error?.code !== "EEXIST") {
|
|
278
|
+
return { taken: true };
|
|
279
|
+
}
|
|
280
|
+
const pid2 = claimantPid(path);
|
|
281
|
+
if (pid2 !== null && pid2 !== runtime.selfPid && runtime.isAlive(pid2)) return { taken: false, claimant: pid2 };
|
|
282
|
+
try {
|
|
283
|
+
node_fs.unlinkSync(path);
|
|
284
|
+
} catch {
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const pid = claimantPid(path);
|
|
289
|
+
return pid !== null && pid !== runtime.selfPid ? { taken: false, claimant: pid } : { taken: true };
|
|
290
|
+
}
|
|
291
|
+
function releaseClaim(happySessionId, runtime) {
|
|
292
|
+
const path = claimPath(happySessionId, runtime.dir);
|
|
293
|
+
if (claimantPid(path) !== runtime.selfPid) return;
|
|
294
|
+
try {
|
|
295
|
+
node_fs.unlinkSync(path);
|
|
296
|
+
} catch {
|
|
297
|
+
}
|
|
298
|
+
}
|
|
307
299
|
function acquireSessionLock(happySessionId, options, runtime = defaultRuntime()) {
|
|
308
300
|
const record = () => ({
|
|
309
301
|
pid: runtime.selfPid,
|
|
@@ -311,24 +303,48 @@ function acquireSessionLock(happySessionId, options, runtime = defaultRuntime())
|
|
|
311
303
|
version: options.version,
|
|
312
304
|
...options.flavor ? { flavor: options.flavor } : {}
|
|
313
305
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
306
|
+
return new Promise((settle) => {
|
|
307
|
+
const deadline = runtime.now() + (options.claimWaitMs ?? SESSION_CLAIM_WAIT_MS);
|
|
308
|
+
const attempt = () => {
|
|
309
|
+
const claim = tryTakeClaim(happySessionId, runtime);
|
|
310
|
+
if (!claim.taken) {
|
|
311
|
+
if (runtime.now() >= deadline) {
|
|
312
|
+
settle({ ok: false, holder: { pid: claim.claimant, startedAt: 0, version: "" } });
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
runtime.schedule(attempt, SESSION_CLAIM_POLL_MS);
|
|
316
|
+
return;
|
|
317
|
+
}
|
|
318
|
+
const resolve = (result) => {
|
|
319
|
+
releaseClaim(happySessionId, runtime);
|
|
320
|
+
settle(result);
|
|
321
|
+
};
|
|
322
|
+
const holder = liveSessionLockHolder(happySessionId, runtime);
|
|
323
|
+
if (!holder) {
|
|
324
|
+
writeSessionLock(happySessionId, record(), runtime.dir);
|
|
325
|
+
resolve({ ok: true, replaced: null });
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (!options.takeover) {
|
|
325
329
|
resolve({ ok: false, holder });
|
|
326
330
|
return;
|
|
327
331
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
+
const requested = processTermination.terminateProcessTree(holder.pid, (stopped) => {
|
|
333
|
+
if (!stopped) {
|
|
334
|
+
resolve({ ok: false, holder });
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
writeSessionLock(happySessionId, record(), runtime.dir);
|
|
338
|
+
resolve({ ok: true, replaced: holder });
|
|
339
|
+
}, {
|
|
340
|
+
...runtime.tree,
|
|
341
|
+
runtime,
|
|
342
|
+
graceMs: options.graceMs ?? 2e3,
|
|
343
|
+
onLeftovers: (pids) => logger.logger.debug(`[SESSION LOCK] ${happySessionId}: takeover of ${holder.pid} left ${pids.join(", ")} running`)
|
|
344
|
+
});
|
|
345
|
+
if (!requested) resolve({ ok: false, holder });
|
|
346
|
+
};
|
|
347
|
+
attempt();
|
|
332
348
|
});
|
|
333
349
|
}
|
|
334
350
|
function releaseSessionLock(happySessionId, runtime = defaultRuntime()) {
|
|
@@ -378,8 +394,6 @@ exports.recordAttempt = recordAttempt;
|
|
|
378
394
|
exports.resolveQuietMs = resolveQuietMs;
|
|
379
395
|
exports.statusFromVerdict = statusFromVerdict;
|
|
380
396
|
exports.takeAutoRestartedEvent = takeAutoRestartedEvent;
|
|
381
|
-
exports.terminateProcess = terminateProcess;
|
|
382
|
-
exports.terminateProcessTree = terminateProcessTree;
|
|
383
397
|
exports.withoutServerSnapshot = withoutServerSnapshot;
|
|
384
398
|
exports.wrapperReportsIdle = wrapperReportsIdle;
|
|
385
399
|
exports.wrapperStaleness = wrapperStaleness;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var configuration = require('./configuration-
|
|
4
|
+
var configuration = require('./configuration-BL_fxboH.cjs');
|
|
5
5
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
6
|
-
var controlClient = require('./controlClient-
|
|
7
|
-
var persistence = require('./persistence-
|
|
6
|
+
var controlClient = require('./controlClient-DMtkGpc3.cjs');
|
|
7
|
+
var persistence = require('./persistence-CWEaFv6R.cjs');
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
9
|
-
var time = require('./time-
|
|
9
|
+
var time = require('./time-BTXLicT9.cjs');
|
|
10
10
|
var specialCommands = require('./specialCommands-J3JFOq0J.cjs');
|
|
11
11
|
var socket_ioClient = require('socket.io-client');
|
|
12
12
|
var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
2
|
+
import { c as configuration } from './configuration-BIh6P6kB.mjs';
|
|
3
3
|
import { e as encodeBase64, g as encrypt, d as decodeBase64, h as decrypt } from './authRelay-DhQhkBvX.mjs';
|
|
4
|
-
import { l as listDaemonSessions, f as stopDaemonSession } from './controlClient-
|
|
5
|
-
import { b as readCredentialsForConfiguredRelay, c as readPersistedSessions } from './persistence-
|
|
4
|
+
import { l as listDaemonSessions, f as stopDaemonSession } from './controlClient-CPZkMKsH.mjs';
|
|
5
|
+
import { b as readCredentialsForConfiguredRelay, c as readPersistedSessions } from './persistence-CPIj3Iha.mjs';
|
|
6
6
|
import { randomUUID } from 'node:crypto';
|
|
7
|
-
import { d as delay } from './time-
|
|
7
|
+
import { d as delay } from './time-DZ7wPlsL.mjs';
|
|
8
8
|
import { c as compactCommandText, p as parseClear } from './specialCommands-MXUN0wfI.mjs';
|
|
9
9
|
import { io } from 'socket.io-client';
|
|
10
10
|
import { b as backgroundTasksReport } from './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
3
|
-
import { r as restartDaemonSession, l as listDaemonSessions } from './controlClient-
|
|
4
|
-
import { A as AccountService, l as localRestartFailure, b as bindResultMessages } from './accountService-
|
|
5
|
-
import { r as readSessionBindings, a as readAccounts } from './store-
|
|
2
|
+
import { c as configuration } from './configuration-BIh6P6kB.mjs';
|
|
3
|
+
import { r as restartDaemonSession, l as listDaemonSessions } from './controlClient-CPZkMKsH.mjs';
|
|
4
|
+
import { A as AccountService, l as localRestartFailure, b as bindResultMessages } from './accountService-DQ21IlBs.mjs';
|
|
5
|
+
import { r as readSessionBindings, a as readAccounts } from './store-BlPvTr_Q.mjs';
|
|
6
6
|
import 'node:fs';
|
|
7
7
|
import 'node:os';
|
|
8
8
|
import 'node:path';
|
|
9
|
-
import './package-
|
|
9
|
+
import './package-DUKnh8UF.mjs';
|
|
10
10
|
import 'node:fs/promises';
|
|
11
|
-
import './logger-
|
|
11
|
+
import './logger-CahcyjlK.mjs';
|
|
12
12
|
import 'node:util';
|
|
13
|
-
import './persistence-
|
|
13
|
+
import './persistence-CPIj3Iha.mjs';
|
|
14
14
|
import 'zod';
|
|
15
15
|
import './authRelay-DhQhkBvX.mjs';
|
|
16
16
|
import 'node:crypto';
|
|
17
17
|
import 'tweetnacl';
|
|
18
|
-
import './index-
|
|
18
|
+
import './index-C27JFCbe.mjs';
|
|
19
19
|
import '@paralleldrive/cuid2';
|
|
20
20
|
import 'node:child_process';
|
|
21
|
-
import './claudeAccountEnv-
|
|
22
|
-
import './codexAccount-
|
|
21
|
+
import './claudeAccountEnv-CPO6CGNd.mjs';
|
|
22
|
+
import './codexAccount-iZwmpYti.mjs';
|
|
23
23
|
import 'node:readline';
|
|
24
24
|
|
|
25
25
|
const SESSION_PROVIDER_HELP = `Usage:
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
|
-
var configuration = require('./configuration-
|
|
5
|
-
var controlClient = require('./controlClient-
|
|
4
|
+
var configuration = require('./configuration-BL_fxboH.cjs');
|
|
5
|
+
var controlClient = require('./controlClient-DMtkGpc3.cjs');
|
|
6
6
|
var accountService = require('./accountService-DL6xhVUa.cjs');
|
|
7
7
|
var store = require('./store-aa3CVNwS.cjs');
|
|
8
8
|
require('node:fs');
|
|
9
9
|
require('node:os');
|
|
10
10
|
require('node:path');
|
|
11
|
-
require('./package-
|
|
11
|
+
require('./package-DdYN77UN.cjs');
|
|
12
12
|
require('node:fs/promises');
|
|
13
|
-
require('./logger-
|
|
13
|
+
require('./logger-CtweAuKq.cjs');
|
|
14
14
|
require('node:util');
|
|
15
|
-
require('./persistence-
|
|
15
|
+
require('./persistence-CWEaFv6R.cjs');
|
|
16
16
|
require('zod');
|
|
17
17
|
require('./authRelay-Dy1qU9td.cjs');
|
|
18
18
|
require('node:crypto');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as InvalidateSync } from './sync-
|
|
1
|
+
import { I as InvalidateSync } from './sync-CHU9HM9N.mjs';
|
|
2
2
|
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { statSync } from 'node:fs';
|
|
5
5
|
import { r as readTranscriptIncrement, i as isValidTranscriptHint } from './transcriptCursor-B7T_gkQ0.mjs';
|
|
6
|
-
import { l as logger } from './logger-
|
|
7
|
-
import { s as startFileWatcher } from './startFileWatcher-
|
|
6
|
+
import { l as logger } from './logger-CahcyjlK.mjs';
|
|
7
|
+
import { s as startFileWatcher } from './startFileWatcher-FjvRihwq.mjs';
|
|
8
8
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
9
9
|
|
|
10
10
|
class Future {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var sync = require('./sync-
|
|
3
|
+
var sync = require('./sync-Dz_U1UHu.cjs');
|
|
4
4
|
var types = require('./types-CRS-srZK.cjs');
|
|
5
5
|
var path$1 = require('node:path');
|
|
6
6
|
var node_fs = require('node:fs');
|
|
7
7
|
var transcriptCursor = require('./transcriptCursor-DcXGLeSc.cjs');
|
|
8
|
-
var logger = require('./logger-
|
|
9
|
-
var startFileWatcher = require('./startFileWatcher-
|
|
8
|
+
var logger = require('./logger-CtweAuKq.cjs');
|
|
9
|
+
var startFileWatcher = require('./startFileWatcher-905w_JCn.cjs');
|
|
10
10
|
var path = require('./path-B7zW-WwE.cjs');
|
|
11
11
|
|
|
12
12
|
class Future {
|