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
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { io } from 'socket.io-client';
|
|
2
2
|
import { a as webPanelsSignature } from './webPanels-B2_C2-3g.mjs';
|
|
3
|
-
import { l as logger } from './logger-
|
|
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-
|
|
5
|
-
import { i as isClaudeSessionId, s as stableVersion, a as sanitizeTagList, p as pickMirrorForTerminal, l as liveSnapshotChanged,
|
|
6
|
-
import { c as configuration } from './configuration-
|
|
3
|
+
import { l as logger } from './logger-CahcyjlK.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-nbXgabCS.mjs';
|
|
5
|
+
import { i as isClaudeSessionId, s as stableVersion, a as sanitizeTagList, p as projectField, b as pickMirrorForTerminal, l as liveSnapshotChanged, c as sanitizeLiveSnapshot, d as serializeLiveSnapshot, r as registerWorktreeHandlers, e as configureWorktreeService, f as summarizeSpawnSessionForLog, g as parseMirrorSendParams } from './mirrorProtocol-OJPFNpbq.mjs';
|
|
6
|
+
import { c as configuration } from './configuration-BIh6P6kB.mjs';
|
|
7
7
|
import { w as withCurrentCliUpdateState } from './cliUpdate-Y34VGe9Y.mjs';
|
|
8
|
-
import { r as registerCommonHandlers } from './registerCommonHandlers-
|
|
8
|
+
import { r as registerCommonHandlers } from './registerCommonHandlers-Anq6Ma1d.mjs';
|
|
9
9
|
import { stat, readdir, lstat, open, readFile, rm, mkdir, chmod, writeFile, rename } from 'node:fs/promises';
|
|
10
10
|
import { join, isAbsolute, resolve } from 'node:path';
|
|
11
11
|
import os, { homedir } from 'node:os';
|
|
12
12
|
import { f as fsMkdir } from './fsMkdir-DumgLTzR.mjs';
|
|
13
13
|
import { spawn, execFile, spawnSync } from 'node:child_process';
|
|
14
|
-
import { r as readSettings, c as readPersistedSessions, p as readTrackedClaudeSessionIds, q as readTrackedCodexThreadIds } from './persistence-
|
|
14
|
+
import { r as readSettings, c as readPersistedSessions, p as readTrackedClaudeSessionIds, q as readTrackedCodexThreadIds } from './persistence-CPIj3Iha.mjs';
|
|
15
15
|
import { M as ModelConfigError } from './fileStore-5qpetZS0.mjs';
|
|
16
|
-
import { a8 as AGENT_PROFILE_RPC, a9 as RelayCandidatesResponseSchema, a4 as RelayAssignmentResponseSchema, a3 as ReleaseDrainNoticeSchema } from './index-
|
|
17
|
-
import { a as AccountError } from './accountService-
|
|
16
|
+
import { a8 as AGENT_PROFILE_RPC, a9 as RelayCandidatesResponseSchema, a4 as RelayAssignmentResponseSchema, a3 as ReleaseDrainNoticeSchema } from './index-C27JFCbe.mjs';
|
|
17
|
+
import { a as AccountError } from './accountService-DQ21IlBs.mjs';
|
|
18
18
|
import { e as encodeBase64, g as encrypt, h as decrypt, d as decodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
19
19
|
import { p as prepareClipboardText, d as prepareClipboardHistoryText } from './limits-DIo7rEBR.mjs';
|
|
20
|
-
import { b as backoff, d as delay } from './time-
|
|
20
|
+
import { b as backoff, d as delay } from './time-DZ7wPlsL.mjs';
|
|
21
21
|
import * as pty from 'node-pty';
|
|
22
|
-
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-
|
|
23
|
-
import { t as tmuxArgs, V as VH_TMUX_SOCKET_ENV, a as scrubTmuxClientEnv } from './tmuxSocket-
|
|
24
|
-
import { locateClaudeConversation, refreshAgentHomes } from './index-
|
|
22
|
+
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-Dc38XmZv.mjs';
|
|
23
|
+
import { t as tmuxArgs, V as VH_TMUX_SOCKET_ENV, v as validateTerminalProjectId, a as scrubTmuxClientEnv } from './tmuxSocket-BmZyixRM.mjs';
|
|
24
|
+
import { locateClaudeConversation, refreshAgentHomes } from './index-BSSAKD4Q.mjs';
|
|
25
25
|
import { randomBytes } from 'node:crypto';
|
|
26
26
|
import { readdirSync, unlinkSync, existsSync, mkdirSync, writeFileSync, readFileSync, statSync, chmodSync, renameSync, rmSync, accessSync, constants } from 'node:fs';
|
|
27
27
|
import axios from 'axios';
|
|
28
28
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
29
29
|
import { a as isValidTerminalId } from './ids-DU6sLx4C.mjs';
|
|
30
30
|
import { d as detectCLIAvailability } from './detectCLI-CSGMlV51.mjs';
|
|
31
|
-
import { d as detectResumeSupport } from './localHappyAgentAuth-
|
|
31
|
+
import { d as detectResumeSupport } from './localHappyAgentAuth-BupJnMMB.mjs';
|
|
32
32
|
import { g as getProjectPath, a as getClaudeProjectsRoot } from './path-D2wdaNSk.mjs';
|
|
33
33
|
import { i as isVeryHappyOneShotPrompt } from './oneShotPrompts-DT4p6RNd.mjs';
|
|
34
|
-
import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, b as forkAndTruncateSession, c as ForkTruncateUuidNotFoundError, e as forkBeforeUserMessage, a as forkCompletedTurns } from './claudeSessionFork-
|
|
35
|
-
import { C as CodexAppServerClient } from './codexAppServerClient-
|
|
34
|
+
import { f as forkSession, F as ForkSourceMissingError, d as discardForkedSession, l as listClaudeRewindPoints, b as forkAndTruncateSession, c as ForkTruncateUuidNotFoundError, e as forkBeforeUserMessage, a as forkCompletedTurns } from './claudeSessionFork-BMMJmfxX.mjs';
|
|
35
|
+
import { C as CodexAppServerClient } from './codexAppServerClient-AcMiUjlK.mjs';
|
|
36
36
|
import { f as forkCodexThread, C as CodexForkRewindPointNotFoundError, l as listCodexRewindPoints, b as forkCodexBeforeUserMessage, a as forkCodexCompletedTurns } from './codexThreadFork-CVzAqELg.mjs';
|
|
37
|
-
import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-
|
|
37
|
+
import { p as planRateLimitWrite, m as mergeRateLimitReports } from './rateLimitWindows-BAfkXSck.mjs';
|
|
38
38
|
import 'chalk';
|
|
39
39
|
import 'node:util';
|
|
40
40
|
import 'os';
|
|
41
41
|
import 'child_process';
|
|
42
|
-
import './package-
|
|
42
|
+
import './package-DUKnh8UF.mjs';
|
|
43
43
|
import 'util';
|
|
44
44
|
import 'fs/promises';
|
|
45
45
|
import 'crypto';
|
|
@@ -47,9 +47,9 @@ import 'path';
|
|
|
47
47
|
import 'cross-spawn';
|
|
48
48
|
import 'zod';
|
|
49
49
|
import '@paralleldrive/cuid2';
|
|
50
|
-
import './claudeAccountEnv-
|
|
51
|
-
import './store-
|
|
52
|
-
import './codexAccount-
|
|
50
|
+
import './claudeAccountEnv-CPO6CGNd.mjs';
|
|
51
|
+
import './store-BlPvTr_Q.mjs';
|
|
52
|
+
import './codexAccount-iZwmpYti.mjs';
|
|
53
53
|
import 'node:readline';
|
|
54
54
|
import 'tweetnacl';
|
|
55
55
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
@@ -465,6 +465,7 @@ function planTerminalRestore(record, facts) {
|
|
|
465
465
|
title: record.title ?? record.attachTmux,
|
|
466
466
|
manual: true,
|
|
467
467
|
tags: record.tags,
|
|
468
|
+
...record.projectId ? { projectId: record.projectId } : {},
|
|
468
469
|
command: attachStartupCommand(matches[0].id, facts.attachSocket),
|
|
469
470
|
attachTmux: record.attachTmux,
|
|
470
471
|
...recordGeometry(record)
|
|
@@ -479,6 +480,7 @@ function planTerminalRestore(record, facts) {
|
|
|
479
480
|
title: record.title,
|
|
480
481
|
manual: record.manual === true,
|
|
481
482
|
tags: record.tags,
|
|
483
|
+
...record.projectId ? { projectId: record.projectId } : {},
|
|
482
484
|
...resumable ? { command: `claude --resume ${record.claudeSessionId}` } : {},
|
|
483
485
|
...recordGeometry(record)
|
|
484
486
|
};
|
|
@@ -6031,6 +6033,7 @@ function selectAutoRestore(candidates, opts) {
|
|
|
6031
6033
|
terminalId: c.id,
|
|
6032
6034
|
...c.tags !== void 0 ? { tags: c.tags } : {},
|
|
6033
6035
|
...c.manual ? { manual: true } : {},
|
|
6036
|
+
...c.projectId ? { projectId: c.projectId } : {},
|
|
6034
6037
|
...c.cols !== void 0 && c.rows !== void 0 ? { cols: c.cols, rows: c.rows } : {},
|
|
6035
6038
|
cwd: c.cwd,
|
|
6036
6039
|
title: c.title,
|
|
@@ -6080,7 +6083,7 @@ function sanitizeClosedTerminals(raw, max = CLOSED_TERMINALS_MAX) {
|
|
|
6080
6083
|
const out = [];
|
|
6081
6084
|
for (const item of raw) {
|
|
6082
6085
|
if (!item || typeof item !== "object") continue;
|
|
6083
|
-
const { id, title, cwd, mirrorSessionId, claudeSessionId, reason, closedAt, tags, manual, attachTmux } = item;
|
|
6086
|
+
const { id, title, cwd, mirrorSessionId, claudeSessionId, reason, closedAt, tags, manual, attachTmux, projectId } = item;
|
|
6084
6087
|
if (typeof id !== "string" || id.length === 0 || typeof closedAt !== "number") continue;
|
|
6085
6088
|
if (seen.has(id)) continue;
|
|
6086
6089
|
seen.add(id);
|
|
@@ -6095,6 +6098,7 @@ function sanitizeClosedTerminals(raw, max = CLOSED_TERMINALS_MAX) {
|
|
|
6095
6098
|
...tagList !== void 0 ? { tags: tagList } : {},
|
|
6096
6099
|
...manual === true ? { manual: true } : {},
|
|
6097
6100
|
...typeof attachTmux === "string" && attachTmux ? { attachTmux } : {},
|
|
6101
|
+
...projectField(projectId),
|
|
6098
6102
|
closedAt
|
|
6099
6103
|
});
|
|
6100
6104
|
}
|
|
@@ -6111,6 +6115,7 @@ function directTerminalItems(sessions, tmuxIds) {
|
|
|
6111
6115
|
id: s.id,
|
|
6112
6116
|
...title ? { title } : {},
|
|
6113
6117
|
tags: s.direct.tags ?? [],
|
|
6118
|
+
projectId: s.direct.projectId ?? null,
|
|
6114
6119
|
...s.direct.manual ? { manual: true } : {},
|
|
6115
6120
|
cwd: s.direct.cwd,
|
|
6116
6121
|
createdAt: s.direct.createdAt,
|
|
@@ -6858,7 +6863,7 @@ function startupInjectionArgs(tmuxSession, command) {
|
|
|
6858
6863
|
];
|
|
6859
6864
|
}
|
|
6860
6865
|
function seenInfoOf(t) {
|
|
6861
|
-
return { title: t.title, cwd: t.cwd, tags: t.tags, manual: t.manual, attachTmux: t.attachTmux, ...seenGeometry(t.paneCols, t.paneRows) };
|
|
6866
|
+
return { title: t.title, cwd: t.cwd, tags: t.tags, manual: t.manual, attachTmux: t.attachTmux, ...t.projectId ? { projectId: t.projectId } : {}, ...seenGeometry(t.paneCols, t.paneRows) };
|
|
6862
6867
|
}
|
|
6863
6868
|
function seenGeometry(cols, rows) {
|
|
6864
6869
|
return cols !== void 0 && rows !== void 0 ? { cols, rows } : {};
|
|
@@ -6878,7 +6883,9 @@ function terminalListSignature(items) {
|
|
|
6878
6883
|
// list, or the web never learns the toggle became available.
|
|
6879
6884
|
t.mirrorSessionId ?? "",
|
|
6880
6885
|
t.attachTmux ?? "",
|
|
6881
|
-
t.direct ? 1 : 0
|
|
6886
|
+
t.direct ? 1 : 0,
|
|
6887
|
+
// B-868: moving a terminal between projects must push at once.
|
|
6888
|
+
t.projectId ?? ""
|
|
6882
6889
|
]);
|
|
6883
6890
|
return JSON.stringify(canon);
|
|
6884
6891
|
}
|
|
@@ -7730,6 +7737,7 @@ class WebTerminalManager {
|
|
|
7730
7737
|
tags: info.tags,
|
|
7731
7738
|
manual: info.manual,
|
|
7732
7739
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
7740
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7733
7741
|
...seenGeometry(info.cols, info.rows),
|
|
7734
7742
|
// Live binding first (authoritative while it exists), persisted
|
|
7735
7743
|
// metadata as the fallback once the mirror has been torn down.
|
|
@@ -7785,6 +7793,7 @@ class WebTerminalManager {
|
|
|
7785
7793
|
tags: info.tags,
|
|
7786
7794
|
manual: info.manual,
|
|
7787
7795
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
7796
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7788
7797
|
...seenGeometry(info.cols, info.rows),
|
|
7789
7798
|
mirrorSessionId: mirror?.sessionId,
|
|
7790
7799
|
claudeSessionId: mirror?.claudeSessionId,
|
|
@@ -7798,6 +7807,7 @@ class WebTerminalManager {
|
|
|
7798
7807
|
cwd: info.cwd,
|
|
7799
7808
|
tags: info.tags,
|
|
7800
7809
|
manual: info.manual,
|
|
7810
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7801
7811
|
...seenGeometry(info.cols, info.rows),
|
|
7802
7812
|
seenAt: info.seenAt,
|
|
7803
7813
|
claudeSessionId: mirror?.claudeSessionId
|
|
@@ -7988,6 +7998,14 @@ class WebTerminalManager {
|
|
|
7988
7998
|
{ stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env }
|
|
7989
7999
|
);
|
|
7990
8000
|
}
|
|
8001
|
+
const projectId = validateTerminalProjectId(plan.projectId);
|
|
8002
|
+
if (projectId) {
|
|
8003
|
+
spawnSync(
|
|
8004
|
+
"tmux",
|
|
8005
|
+
tmuxArgs(["set-option", "-t", `=${name}:`, "@vh_project", projectId]),
|
|
8006
|
+
{ stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env }
|
|
8007
|
+
);
|
|
8008
|
+
}
|
|
7991
8009
|
if (plan.command) {
|
|
7992
8010
|
const command = withTerminalHooks(plan.command, plan.terminalId, this.claudeVersion.current());
|
|
7993
8011
|
for (const argv of startupInjectionArgs(name, command)) {
|
|
@@ -8001,7 +8019,7 @@ class WebTerminalManager {
|
|
|
8001
8019
|
* would care about changed (see liveSnapshotChanged). */
|
|
8002
8020
|
persistLiveSnapshot(live, now) {
|
|
8003
8021
|
const candidate = /* @__PURE__ */ new Map();
|
|
8004
|
-
for (const [id, info] of live) candidate.set(id, { title: info.title, cwd: info.cwd, tags: info.tags, manual: info.manual, ...info.attachTmux ? { attachTmux: info.attachTmux } : {}, ...seenGeometry(info.cols, info.rows), seenAt: now });
|
|
8022
|
+
for (const [id, info] of live) candidate.set(id, { title: info.title, cwd: info.cwd, tags: info.tags, manual: info.manual, ...info.attachTmux ? { attachTmux: info.attachTmux } : {}, ...info.projectId ? { projectId: info.projectId } : {}, ...seenGeometry(info.cols, info.rows), seenAt: now });
|
|
8005
8023
|
if (!liveSnapshotChanged(this.lastPersistedSnapshot, candidate)) return;
|
|
8006
8024
|
this.lastPersistedSnapshot = candidate;
|
|
8007
8025
|
saveLiveSnapshot(candidate);
|
|
@@ -8222,7 +8240,7 @@ class WebTerminalManager {
|
|
|
8222
8240
|
}
|
|
8223
8241
|
}
|
|
8224
8242
|
if (createdNew) {
|
|
8225
|
-
attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env);
|
|
8243
|
+
attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env, opts.projectId);
|
|
8226
8244
|
} else if (opts.attachTmux && !attachOnly) {
|
|
8227
8245
|
const stored = spawnSync(
|
|
8228
8246
|
"tmux",
|
|
@@ -8245,7 +8263,7 @@ class WebTerminalManager {
|
|
|
8245
8263
|
{ stdio: "ignore", timeout: TMUX_CREATE_TIMEOUT_MS, env }
|
|
8246
8264
|
);
|
|
8247
8265
|
createdNew = retry.status === 0;
|
|
8248
|
-
if (createdNew) attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env);
|
|
8266
|
+
if (createdNew) attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env, opts.projectId);
|
|
8249
8267
|
}
|
|
8250
8268
|
}
|
|
8251
8269
|
if (!attachOnly && !createdNew) {
|
|
@@ -8324,7 +8342,8 @@ class WebTerminalManager {
|
|
|
8324
8342
|
}
|
|
8325
8343
|
}
|
|
8326
8344
|
const created = new TerminalSession(id, { kind: "pty", pty: proc }, void 0, cols, rows);
|
|
8327
|
-
|
|
8345
|
+
const createProject = validateTerminalProjectId(opts.projectId);
|
|
8346
|
+
created.direct = { cwd, createdAt: Date.now(), ...createProject ? { projectId: createProject } : {} };
|
|
8328
8347
|
created.onTitleChange((title) => {
|
|
8329
8348
|
if (created.direct && !created.direct.manual) created.direct.title = deriveAutoTitle(title, os.hostname(), created.direct.cwd);
|
|
8330
8349
|
});
|
|
@@ -8372,7 +8391,14 @@ class WebTerminalManager {
|
|
|
8372
8391
|
* records / restore and types the attach line; otherwise the ordinary
|
|
8373
8392
|
* startup command runs. Returns what to echo as `attachedTmux`.
|
|
8374
8393
|
*/
|
|
8375
|
-
injectIntoCreated(tmuxSession, attachTarget, startupCommand, env) {
|
|
8394
|
+
injectIntoCreated(tmuxSession, attachTarget, startupCommand, env, projectId) {
|
|
8395
|
+
const project = validateTerminalProjectId(projectId);
|
|
8396
|
+
if (project) {
|
|
8397
|
+
try {
|
|
8398
|
+
spawnSync("tmux", tmuxArgs(["set-option", "-t", `=${tmuxSession}:`, "@vh_project", project]), { stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env });
|
|
8399
|
+
} catch {
|
|
8400
|
+
}
|
|
8401
|
+
}
|
|
8376
8402
|
if (attachTarget) {
|
|
8377
8403
|
for (const a of [
|
|
8378
8404
|
["set-option", "-t", `=${tmuxSession}:`, "@vh_title", attachTarget.name],
|
|
@@ -8693,6 +8719,7 @@ class WebTerminalManager {
|
|
|
8693
8719
|
cwd: liveDirect.direct.cwd,
|
|
8694
8720
|
tags: liveDirect.direct.tags ?? [],
|
|
8695
8721
|
...liveDirect.direct.manual ? { manual: true } : {},
|
|
8722
|
+
...liveDirect.direct.projectId ? { projectId: liveDirect.direct.projectId } : {},
|
|
8696
8723
|
reason: "closed",
|
|
8697
8724
|
closedAt: Date.now()
|
|
8698
8725
|
});
|
|
@@ -8736,6 +8763,7 @@ class WebTerminalManager {
|
|
|
8736
8763
|
tags: info.tags,
|
|
8737
8764
|
manual: info.manual,
|
|
8738
8765
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
8766
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
8739
8767
|
...seenGeometry(info.cols, info.rows),
|
|
8740
8768
|
mirrorSessionId: this.mirrorResolver?.(terminalId) ?? mirror?.sessionId,
|
|
8741
8769
|
claudeSessionId: mirror?.claudeSessionId,
|
|
@@ -8826,6 +8854,7 @@ class WebTerminalManager {
|
|
|
8826
8854
|
title,
|
|
8827
8855
|
// Always include [] so Web can feature-detect tag support.
|
|
8828
8856
|
tags: s.tags,
|
|
8857
|
+
projectId: s.projectId,
|
|
8829
8858
|
cwd: s.cwd,
|
|
8830
8859
|
createdAt: s.created,
|
|
8831
8860
|
// tmux last-activity (epoch s) → ms; optional so old daemons
|
|
@@ -9066,6 +9095,34 @@ class WebTerminalManager {
|
|
|
9066
9095
|
return false;
|
|
9067
9096
|
}
|
|
9068
9097
|
}
|
|
9098
|
+
/** B-868: put the terminal in a Very Happy project, or take it out (null).
|
|
9099
|
+
* Only the id is stored (`@vh_project`); the web resolves it against the
|
|
9100
|
+
* account's projects. Nothing is ever injected into the terminal. */
|
|
9101
|
+
setProject(terminalId, projectId) {
|
|
9102
|
+
const direct = this.terminals.get(terminalId)?.direct;
|
|
9103
|
+
if (!direct && !isTmuxAvailable()) return false;
|
|
9104
|
+
if (!/^[a-zA-Z0-9_-]{1,64}$/.test(terminalId)) return false;
|
|
9105
|
+
const valid = validateTerminalProjectId(projectId);
|
|
9106
|
+
if (valid === void 0) return false;
|
|
9107
|
+
if (direct) {
|
|
9108
|
+
if (valid) direct.projectId = valid;
|
|
9109
|
+
else delete direct.projectId;
|
|
9110
|
+
this.kickListRefresh();
|
|
9111
|
+
return true;
|
|
9112
|
+
}
|
|
9113
|
+
const target = `=vh-${terminalId}:`;
|
|
9114
|
+
try {
|
|
9115
|
+
const r = spawnSync("tmux", tmuxArgs(valid ? ["set-option", "-t", target, "@vh_project", valid] : ["set-option", "-u", "-t", target, "@vh_project"]), {
|
|
9116
|
+
stdio: "ignore",
|
|
9117
|
+
env: ptyEnv()
|
|
9118
|
+
});
|
|
9119
|
+
if (r.status !== 0) return false;
|
|
9120
|
+
this.kickListRefresh();
|
|
9121
|
+
return true;
|
|
9122
|
+
} catch {
|
|
9123
|
+
return false;
|
|
9124
|
+
}
|
|
9125
|
+
}
|
|
9069
9126
|
}
|
|
9070
9127
|
|
|
9071
9128
|
const UUID_RE$4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -10914,7 +10971,7 @@ class ApiMachineClient {
|
|
|
10914
10971
|
this.syncResumeSessionRpcRegistration();
|
|
10915
10972
|
this.syncRestartSessionRpcRegistration();
|
|
10916
10973
|
this.rpcHandlerManager.registerHandler("open-terminal", async (params) => {
|
|
10917
|
-
const { terminalId, cols, rows, cwd, fromSeq, encStream, startupCommand, resub, attachOnly, streamMode, attachTmux } = params || {};
|
|
10974
|
+
const { terminalId, cols, rows, cwd, fromSeq, encStream, startupCommand, resub, attachOnly, streamMode, attachTmux, projectId } = params || {};
|
|
10918
10975
|
const attach = attachTmux && typeof attachTmux === "object" && typeof attachTmux.id === "string" && typeof attachTmux.name === "string" ? { id: attachTmux.id, name: attachTmux.name } : void 0;
|
|
10919
10976
|
const result = await this.webTerminal.open({
|
|
10920
10977
|
terminalId,
|
|
@@ -10926,7 +10983,9 @@ class ApiMachineClient {
|
|
|
10926
10983
|
resub,
|
|
10927
10984
|
attachOnly,
|
|
10928
10985
|
streamMode: streamMode === "lines" ? "lines" : void 0,
|
|
10929
|
-
...attach ? { attachTmux: attach } : {}
|
|
10986
|
+
...attach ? { attachTmux: attach } : {},
|
|
10987
|
+
// B-868: create-only; validated inside open().
|
|
10988
|
+
...typeof projectId === "string" ? { projectId } : {}
|
|
10930
10989
|
});
|
|
10931
10990
|
if (encStream) {
|
|
10932
10991
|
this.encTerminals.add(result.terminalId);
|
|
@@ -11024,6 +11083,16 @@ class ApiMachineClient {
|
|
|
11024
11083
|
}
|
|
11025
11084
|
return { type: "success" };
|
|
11026
11085
|
});
|
|
11086
|
+
this.rpcHandlerManager.registerHandler("set-terminal-project", async (params) => {
|
|
11087
|
+
const { terminalId, projectId } = params || {};
|
|
11088
|
+
if (typeof terminalId !== "string" || !terminalId || projectId === void 0) {
|
|
11089
|
+
throw new Error("terminalId and projectId are required");
|
|
11090
|
+
}
|
|
11091
|
+
if (!this.webTerminal.setProject(terminalId, projectId)) {
|
|
11092
|
+
throw new Error("Failed to set terminal project (invalid id, tmux unavailable, or session gone)");
|
|
11093
|
+
}
|
|
11094
|
+
return { type: "success" };
|
|
11095
|
+
});
|
|
11027
11096
|
this.rpcHandlerManager.registerHandler("stop-session", (params) => {
|
|
11028
11097
|
const { sessionId } = params || {};
|
|
11029
11098
|
if (!sessionId) {
|
|
@@ -11537,6 +11606,8 @@ class ApiMachineClient {
|
|
|
11537
11606
|
codexHistory: { rpcAvailable: true, detectedAt: now },
|
|
11538
11607
|
// B-549 capability flag: `history-search` (same restamp discipline).
|
|
11539
11608
|
historySearch: { rpcAvailable: true, detectedAt: now },
|
|
11609
|
+
// B-868 capability flag: `set-terminal-project` (same restamp discipline).
|
|
11610
|
+
terminalProjects: { rpcAvailable: true, detectedAt: now },
|
|
11540
11611
|
// B-084: closed records survive daemon restarts (persisted
|
|
11541
11612
|
// in closed-terminals.json), so the connect snapshot ships
|
|
11542
11613
|
// them too — not just the incremental pushes.
|
|
@@ -2,46 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
var socket_ioClient = require('socket.io-client');
|
|
4
4
|
var webPanels = require('./webPanels-FCgFKvVe.cjs');
|
|
5
|
-
var logger = require('./logger-
|
|
6
|
-
var lidState = require('./lidState-
|
|
7
|
-
var mirrorProtocol = require('./mirrorProtocol-
|
|
8
|
-
var configuration = require('./configuration-
|
|
5
|
+
var logger = require('./logger-CtweAuKq.cjs');
|
|
6
|
+
var lidState = require('./lidState-DXy1ymL0.cjs');
|
|
7
|
+
var mirrorProtocol = require('./mirrorProtocol-CFDn3zfT.cjs');
|
|
8
|
+
var configuration = require('./configuration-BL_fxboH.cjs');
|
|
9
9
|
var cliUpdate = require('./cliUpdate-DsKXPFYp.cjs');
|
|
10
|
-
var registerCommonHandlers = require('./registerCommonHandlers-
|
|
10
|
+
var registerCommonHandlers = require('./registerCommonHandlers-CsMpXP1_.cjs');
|
|
11
11
|
var promises = require('node:fs/promises');
|
|
12
12
|
var path = require('node:path');
|
|
13
13
|
var os = require('node:os');
|
|
14
14
|
var fsMkdir = require('./fsMkdir-0K3yENml.cjs');
|
|
15
15
|
var node_child_process = require('node:child_process');
|
|
16
|
-
var persistence = require('./persistence-
|
|
16
|
+
var persistence = require('./persistence-CWEaFv6R.cjs');
|
|
17
17
|
var fileStore = require('./fileStore-7qhnbs6N.cjs');
|
|
18
18
|
var index = require('./index-D9Hidq-g.cjs');
|
|
19
19
|
var accountService = require('./accountService-DL6xhVUa.cjs');
|
|
20
20
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
21
21
|
var limits = require('./limits-C-a7gr04.cjs');
|
|
22
|
-
var time = require('./time-
|
|
22
|
+
var time = require('./time-BTXLicT9.cjs');
|
|
23
23
|
var pty = require('node-pty');
|
|
24
|
-
var terminals = require('./terminals-
|
|
25
|
-
var tmuxSocket = require('./tmuxSocket-
|
|
26
|
-
var index$1 = require('./index-
|
|
24
|
+
var terminals = require('./terminals-dK3Lrjfp.cjs');
|
|
25
|
+
var tmuxSocket = require('./tmuxSocket-Dg11Olx0.cjs');
|
|
26
|
+
var index$1 = require('./index-XeWmi_Wt.cjs');
|
|
27
27
|
var node_crypto = require('node:crypto');
|
|
28
28
|
var node_fs = require('node:fs');
|
|
29
29
|
var axios = require('axios');
|
|
30
30
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
31
31
|
var ids = require('./ids-B6ZC0HGt.cjs');
|
|
32
32
|
var detectCLI = require('./detectCLI-BuYR_Qxe.cjs');
|
|
33
|
-
var localHappyAgentAuth = require('./localHappyAgentAuth-
|
|
33
|
+
var localHappyAgentAuth = require('./localHappyAgentAuth-Dxl6itKW.cjs');
|
|
34
34
|
var path$1 = require('./path-B7zW-WwE.cjs');
|
|
35
35
|
var oneShotPrompts = require('./oneShotPrompts-CL0dip9C.cjs');
|
|
36
|
-
var claudeSessionFork = require('./claudeSessionFork
|
|
37
|
-
var codexAppServerClient = require('./codexAppServerClient-
|
|
36
|
+
var claudeSessionFork = require('./claudeSessionFork--_RtwhC2.cjs');
|
|
37
|
+
var codexAppServerClient = require('./codexAppServerClient-C4FYS9D9.cjs');
|
|
38
38
|
var codexThreadFork = require('./codexThreadFork-C6ZmcT2z.cjs');
|
|
39
|
-
var rateLimitWindows = require('./rateLimitWindows-
|
|
39
|
+
var rateLimitWindows = require('./rateLimitWindows-_KfSDJdB.cjs');
|
|
40
40
|
require('chalk');
|
|
41
41
|
require('node:util');
|
|
42
42
|
require('os');
|
|
43
43
|
require('child_process');
|
|
44
|
-
require('./package-
|
|
44
|
+
require('./package-DdYN77UN.cjs');
|
|
45
45
|
require('util');
|
|
46
46
|
require('fs/promises');
|
|
47
47
|
require('crypto');
|
|
@@ -486,6 +486,7 @@ function planTerminalRestore(record, facts) {
|
|
|
486
486
|
title: record.title ?? record.attachTmux,
|
|
487
487
|
manual: true,
|
|
488
488
|
tags: record.tags,
|
|
489
|
+
...record.projectId ? { projectId: record.projectId } : {},
|
|
489
490
|
command: terminals.attachStartupCommand(matches[0].id, facts.attachSocket),
|
|
490
491
|
attachTmux: record.attachTmux,
|
|
491
492
|
...recordGeometry(record)
|
|
@@ -500,6 +501,7 @@ function planTerminalRestore(record, facts) {
|
|
|
500
501
|
title: record.title,
|
|
501
502
|
manual: record.manual === true,
|
|
502
503
|
tags: record.tags,
|
|
504
|
+
...record.projectId ? { projectId: record.projectId } : {},
|
|
503
505
|
...resumable ? { command: `claude --resume ${record.claudeSessionId}` } : {},
|
|
504
506
|
...recordGeometry(record)
|
|
505
507
|
};
|
|
@@ -6052,6 +6054,7 @@ function selectAutoRestore(candidates, opts) {
|
|
|
6052
6054
|
terminalId: c.id,
|
|
6053
6055
|
...c.tags !== void 0 ? { tags: c.tags } : {},
|
|
6054
6056
|
...c.manual ? { manual: true } : {},
|
|
6057
|
+
...c.projectId ? { projectId: c.projectId } : {},
|
|
6055
6058
|
...c.cols !== void 0 && c.rows !== void 0 ? { cols: c.cols, rows: c.rows } : {},
|
|
6056
6059
|
cwd: c.cwd,
|
|
6057
6060
|
title: c.title,
|
|
@@ -6101,7 +6104,7 @@ function sanitizeClosedTerminals(raw, max = CLOSED_TERMINALS_MAX) {
|
|
|
6101
6104
|
const out = [];
|
|
6102
6105
|
for (const item of raw) {
|
|
6103
6106
|
if (!item || typeof item !== "object") continue;
|
|
6104
|
-
const { id, title, cwd, mirrorSessionId, claudeSessionId, reason, closedAt, tags, manual, attachTmux } = item;
|
|
6107
|
+
const { id, title, cwd, mirrorSessionId, claudeSessionId, reason, closedAt, tags, manual, attachTmux, projectId } = item;
|
|
6105
6108
|
if (typeof id !== "string" || id.length === 0 || typeof closedAt !== "number") continue;
|
|
6106
6109
|
if (seen.has(id)) continue;
|
|
6107
6110
|
seen.add(id);
|
|
@@ -6116,6 +6119,7 @@ function sanitizeClosedTerminals(raw, max = CLOSED_TERMINALS_MAX) {
|
|
|
6116
6119
|
...tagList !== void 0 ? { tags: tagList } : {},
|
|
6117
6120
|
...manual === true ? { manual: true } : {},
|
|
6118
6121
|
...typeof attachTmux === "string" && attachTmux ? { attachTmux } : {},
|
|
6122
|
+
...mirrorProtocol.projectField(projectId),
|
|
6119
6123
|
closedAt
|
|
6120
6124
|
});
|
|
6121
6125
|
}
|
|
@@ -6132,6 +6136,7 @@ function directTerminalItems(sessions, tmuxIds) {
|
|
|
6132
6136
|
id: s.id,
|
|
6133
6137
|
...title ? { title } : {},
|
|
6134
6138
|
tags: s.direct.tags ?? [],
|
|
6139
|
+
projectId: s.direct.projectId ?? null,
|
|
6135
6140
|
...s.direct.manual ? { manual: true } : {},
|
|
6136
6141
|
cwd: s.direct.cwd,
|
|
6137
6142
|
createdAt: s.direct.createdAt,
|
|
@@ -6879,7 +6884,7 @@ function startupInjectionArgs(tmuxSession, command) {
|
|
|
6879
6884
|
];
|
|
6880
6885
|
}
|
|
6881
6886
|
function seenInfoOf(t) {
|
|
6882
|
-
return { title: t.title, cwd: t.cwd, tags: t.tags, manual: t.manual, attachTmux: t.attachTmux, ...seenGeometry(t.paneCols, t.paneRows) };
|
|
6887
|
+
return { title: t.title, cwd: t.cwd, tags: t.tags, manual: t.manual, attachTmux: t.attachTmux, ...t.projectId ? { projectId: t.projectId } : {}, ...seenGeometry(t.paneCols, t.paneRows) };
|
|
6883
6888
|
}
|
|
6884
6889
|
function seenGeometry(cols, rows) {
|
|
6885
6890
|
return cols !== void 0 && rows !== void 0 ? { cols, rows } : {};
|
|
@@ -6899,7 +6904,9 @@ function terminalListSignature(items) {
|
|
|
6899
6904
|
// list, or the web never learns the toggle became available.
|
|
6900
6905
|
t.mirrorSessionId ?? "",
|
|
6901
6906
|
t.attachTmux ?? "",
|
|
6902
|
-
t.direct ? 1 : 0
|
|
6907
|
+
t.direct ? 1 : 0,
|
|
6908
|
+
// B-868: moving a terminal between projects must push at once.
|
|
6909
|
+
t.projectId ?? ""
|
|
6903
6910
|
]);
|
|
6904
6911
|
return JSON.stringify(canon);
|
|
6905
6912
|
}
|
|
@@ -7751,6 +7758,7 @@ class WebTerminalManager {
|
|
|
7751
7758
|
tags: info.tags,
|
|
7752
7759
|
manual: info.manual,
|
|
7753
7760
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
7761
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7754
7762
|
...seenGeometry(info.cols, info.rows),
|
|
7755
7763
|
// Live binding first (authoritative while it exists), persisted
|
|
7756
7764
|
// metadata as the fallback once the mirror has been torn down.
|
|
@@ -7806,6 +7814,7 @@ class WebTerminalManager {
|
|
|
7806
7814
|
tags: info.tags,
|
|
7807
7815
|
manual: info.manual,
|
|
7808
7816
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
7817
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7809
7818
|
...seenGeometry(info.cols, info.rows),
|
|
7810
7819
|
mirrorSessionId: mirror?.sessionId,
|
|
7811
7820
|
claudeSessionId: mirror?.claudeSessionId,
|
|
@@ -7819,6 +7828,7 @@ class WebTerminalManager {
|
|
|
7819
7828
|
cwd: info.cwd,
|
|
7820
7829
|
tags: info.tags,
|
|
7821
7830
|
manual: info.manual,
|
|
7831
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
7822
7832
|
...seenGeometry(info.cols, info.rows),
|
|
7823
7833
|
seenAt: info.seenAt,
|
|
7824
7834
|
claudeSessionId: mirror?.claudeSessionId
|
|
@@ -8009,6 +8019,14 @@ class WebTerminalManager {
|
|
|
8009
8019
|
{ stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env }
|
|
8010
8020
|
);
|
|
8011
8021
|
}
|
|
8022
|
+
const projectId = tmuxSocket.validateTerminalProjectId(plan.projectId);
|
|
8023
|
+
if (projectId) {
|
|
8024
|
+
node_child_process.spawnSync(
|
|
8025
|
+
"tmux",
|
|
8026
|
+
tmuxSocket.tmuxArgs(["set-option", "-t", `=${name}:`, "@vh_project", projectId]),
|
|
8027
|
+
{ stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env }
|
|
8028
|
+
);
|
|
8029
|
+
}
|
|
8012
8030
|
if (plan.command) {
|
|
8013
8031
|
const command = withTerminalHooks(plan.command, plan.terminalId, this.claudeVersion.current());
|
|
8014
8032
|
for (const argv of startupInjectionArgs(name, command)) {
|
|
@@ -8022,7 +8040,7 @@ class WebTerminalManager {
|
|
|
8022
8040
|
* would care about changed (see liveSnapshotChanged). */
|
|
8023
8041
|
persistLiveSnapshot(live, now) {
|
|
8024
8042
|
const candidate = /* @__PURE__ */ new Map();
|
|
8025
|
-
for (const [id, info] of live) candidate.set(id, { title: info.title, cwd: info.cwd, tags: info.tags, manual: info.manual, ...info.attachTmux ? { attachTmux: info.attachTmux } : {}, ...seenGeometry(info.cols, info.rows), seenAt: now });
|
|
8043
|
+
for (const [id, info] of live) candidate.set(id, { title: info.title, cwd: info.cwd, tags: info.tags, manual: info.manual, ...info.attachTmux ? { attachTmux: info.attachTmux } : {}, ...info.projectId ? { projectId: info.projectId } : {}, ...seenGeometry(info.cols, info.rows), seenAt: now });
|
|
8026
8044
|
if (!mirrorProtocol.liveSnapshotChanged(this.lastPersistedSnapshot, candidate)) return;
|
|
8027
8045
|
this.lastPersistedSnapshot = candidate;
|
|
8028
8046
|
saveLiveSnapshot(candidate);
|
|
@@ -8243,7 +8261,7 @@ class WebTerminalManager {
|
|
|
8243
8261
|
}
|
|
8244
8262
|
}
|
|
8245
8263
|
if (createdNew) {
|
|
8246
|
-
attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env);
|
|
8264
|
+
attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env, opts.projectId);
|
|
8247
8265
|
} else if (opts.attachTmux && !attachOnly) {
|
|
8248
8266
|
const stored = node_child_process.spawnSync(
|
|
8249
8267
|
"tmux",
|
|
@@ -8266,7 +8284,7 @@ class WebTerminalManager {
|
|
|
8266
8284
|
{ stdio: "ignore", timeout: TMUX_CREATE_TIMEOUT_MS, env }
|
|
8267
8285
|
);
|
|
8268
8286
|
createdNew = retry.status === 0;
|
|
8269
|
-
if (createdNew) attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env);
|
|
8287
|
+
if (createdNew) attachedTmux = this.injectIntoCreated(tmuxSession, attachTarget, opts.startupCommand, env, opts.projectId);
|
|
8270
8288
|
}
|
|
8271
8289
|
}
|
|
8272
8290
|
if (!attachOnly && !createdNew) {
|
|
@@ -8345,7 +8363,8 @@ class WebTerminalManager {
|
|
|
8345
8363
|
}
|
|
8346
8364
|
}
|
|
8347
8365
|
const created = new TerminalSession(id, { kind: "pty", pty: proc }, void 0, cols, rows);
|
|
8348
|
-
|
|
8366
|
+
const createProject = tmuxSocket.validateTerminalProjectId(opts.projectId);
|
|
8367
|
+
created.direct = { cwd, createdAt: Date.now(), ...createProject ? { projectId: createProject } : {} };
|
|
8349
8368
|
created.onTitleChange((title) => {
|
|
8350
8369
|
if (created.direct && !created.direct.manual) created.direct.title = terminals.deriveAutoTitle(title, os.hostname(), created.direct.cwd);
|
|
8351
8370
|
});
|
|
@@ -8393,7 +8412,14 @@ class WebTerminalManager {
|
|
|
8393
8412
|
* records / restore and types the attach line; otherwise the ordinary
|
|
8394
8413
|
* startup command runs. Returns what to echo as `attachedTmux`.
|
|
8395
8414
|
*/
|
|
8396
|
-
injectIntoCreated(tmuxSession, attachTarget, startupCommand, env) {
|
|
8415
|
+
injectIntoCreated(tmuxSession, attachTarget, startupCommand, env, projectId) {
|
|
8416
|
+
const project = tmuxSocket.validateTerminalProjectId(projectId);
|
|
8417
|
+
if (project) {
|
|
8418
|
+
try {
|
|
8419
|
+
node_child_process.spawnSync("tmux", tmuxSocket.tmuxArgs(["set-option", "-t", `=${tmuxSession}:`, "@vh_project", project]), { stdio: "ignore", timeout: TMUX_PROBE_TIMEOUT_MS, env });
|
|
8420
|
+
} catch {
|
|
8421
|
+
}
|
|
8422
|
+
}
|
|
8397
8423
|
if (attachTarget) {
|
|
8398
8424
|
for (const a of [
|
|
8399
8425
|
["set-option", "-t", `=${tmuxSession}:`, "@vh_title", attachTarget.name],
|
|
@@ -8714,6 +8740,7 @@ class WebTerminalManager {
|
|
|
8714
8740
|
cwd: liveDirect.direct.cwd,
|
|
8715
8741
|
tags: liveDirect.direct.tags ?? [],
|
|
8716
8742
|
...liveDirect.direct.manual ? { manual: true } : {},
|
|
8743
|
+
...liveDirect.direct.projectId ? { projectId: liveDirect.direct.projectId } : {},
|
|
8717
8744
|
reason: "closed",
|
|
8718
8745
|
closedAt: Date.now()
|
|
8719
8746
|
});
|
|
@@ -8757,6 +8784,7 @@ class WebTerminalManager {
|
|
|
8757
8784
|
tags: info.tags,
|
|
8758
8785
|
manual: info.manual,
|
|
8759
8786
|
...info.attachTmux ? { attachTmux: info.attachTmux } : {},
|
|
8787
|
+
...info.projectId ? { projectId: info.projectId } : {},
|
|
8760
8788
|
...seenGeometry(info.cols, info.rows),
|
|
8761
8789
|
mirrorSessionId: this.mirrorResolver?.(terminalId) ?? mirror?.sessionId,
|
|
8762
8790
|
claudeSessionId: mirror?.claudeSessionId,
|
|
@@ -8847,6 +8875,7 @@ class WebTerminalManager {
|
|
|
8847
8875
|
title,
|
|
8848
8876
|
// Always include [] so Web can feature-detect tag support.
|
|
8849
8877
|
tags: s.tags,
|
|
8878
|
+
projectId: s.projectId,
|
|
8850
8879
|
cwd: s.cwd,
|
|
8851
8880
|
createdAt: s.created,
|
|
8852
8881
|
// tmux last-activity (epoch s) → ms; optional so old daemons
|
|
@@ -9087,6 +9116,34 @@ class WebTerminalManager {
|
|
|
9087
9116
|
return false;
|
|
9088
9117
|
}
|
|
9089
9118
|
}
|
|
9119
|
+
/** B-868: put the terminal in a Very Happy project, or take it out (null).
|
|
9120
|
+
* Only the id is stored (`@vh_project`); the web resolves it against the
|
|
9121
|
+
* account's projects. Nothing is ever injected into the terminal. */
|
|
9122
|
+
setProject(terminalId, projectId) {
|
|
9123
|
+
const direct = this.terminals.get(terminalId)?.direct;
|
|
9124
|
+
if (!direct && !isTmuxAvailable()) return false;
|
|
9125
|
+
if (!/^[a-zA-Z0-9_-]{1,64}$/.test(terminalId)) return false;
|
|
9126
|
+
const valid = tmuxSocket.validateTerminalProjectId(projectId);
|
|
9127
|
+
if (valid === void 0) return false;
|
|
9128
|
+
if (direct) {
|
|
9129
|
+
if (valid) direct.projectId = valid;
|
|
9130
|
+
else delete direct.projectId;
|
|
9131
|
+
this.kickListRefresh();
|
|
9132
|
+
return true;
|
|
9133
|
+
}
|
|
9134
|
+
const target = `=vh-${terminalId}:`;
|
|
9135
|
+
try {
|
|
9136
|
+
const r = node_child_process.spawnSync("tmux", tmuxSocket.tmuxArgs(valid ? ["set-option", "-t", target, "@vh_project", valid] : ["set-option", "-u", "-t", target, "@vh_project"]), {
|
|
9137
|
+
stdio: "ignore",
|
|
9138
|
+
env: ptyEnv()
|
|
9139
|
+
});
|
|
9140
|
+
if (r.status !== 0) return false;
|
|
9141
|
+
this.kickListRefresh();
|
|
9142
|
+
return true;
|
|
9143
|
+
} catch {
|
|
9144
|
+
return false;
|
|
9145
|
+
}
|
|
9146
|
+
}
|
|
9090
9147
|
}
|
|
9091
9148
|
|
|
9092
9149
|
const UUID_RE$4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -10935,7 +10992,7 @@ class ApiMachineClient {
|
|
|
10935
10992
|
this.syncResumeSessionRpcRegistration();
|
|
10936
10993
|
this.syncRestartSessionRpcRegistration();
|
|
10937
10994
|
this.rpcHandlerManager.registerHandler("open-terminal", async (params) => {
|
|
10938
|
-
const { terminalId, cols, rows, cwd, fromSeq, encStream, startupCommand, resub, attachOnly, streamMode, attachTmux } = params || {};
|
|
10995
|
+
const { terminalId, cols, rows, cwd, fromSeq, encStream, startupCommand, resub, attachOnly, streamMode, attachTmux, projectId } = params || {};
|
|
10939
10996
|
const attach = attachTmux && typeof attachTmux === "object" && typeof attachTmux.id === "string" && typeof attachTmux.name === "string" ? { id: attachTmux.id, name: attachTmux.name } : void 0;
|
|
10940
10997
|
const result = await this.webTerminal.open({
|
|
10941
10998
|
terminalId,
|
|
@@ -10947,7 +11004,9 @@ class ApiMachineClient {
|
|
|
10947
11004
|
resub,
|
|
10948
11005
|
attachOnly,
|
|
10949
11006
|
streamMode: streamMode === "lines" ? "lines" : void 0,
|
|
10950
|
-
...attach ? { attachTmux: attach } : {}
|
|
11007
|
+
...attach ? { attachTmux: attach } : {},
|
|
11008
|
+
// B-868: create-only; validated inside open().
|
|
11009
|
+
...typeof projectId === "string" ? { projectId } : {}
|
|
10951
11010
|
});
|
|
10952
11011
|
if (encStream) {
|
|
10953
11012
|
this.encTerminals.add(result.terminalId);
|
|
@@ -11045,6 +11104,16 @@ class ApiMachineClient {
|
|
|
11045
11104
|
}
|
|
11046
11105
|
return { type: "success" };
|
|
11047
11106
|
});
|
|
11107
|
+
this.rpcHandlerManager.registerHandler("set-terminal-project", async (params) => {
|
|
11108
|
+
const { terminalId, projectId } = params || {};
|
|
11109
|
+
if (typeof terminalId !== "string" || !terminalId || projectId === void 0) {
|
|
11110
|
+
throw new Error("terminalId and projectId are required");
|
|
11111
|
+
}
|
|
11112
|
+
if (!this.webTerminal.setProject(terminalId, projectId)) {
|
|
11113
|
+
throw new Error("Failed to set terminal project (invalid id, tmux unavailable, or session gone)");
|
|
11114
|
+
}
|
|
11115
|
+
return { type: "success" };
|
|
11116
|
+
});
|
|
11048
11117
|
this.rpcHandlerManager.registerHandler("stop-session", (params) => {
|
|
11049
11118
|
const { sessionId } = params || {};
|
|
11050
11119
|
if (!sessionId) {
|
|
@@ -11558,6 +11627,8 @@ class ApiMachineClient {
|
|
|
11558
11627
|
codexHistory: { rpcAvailable: true, detectedAt: now },
|
|
11559
11628
|
// B-549 capability flag: `history-search` (same restamp discipline).
|
|
11560
11629
|
historySearch: { rpcAvailable: true, detectedAt: now },
|
|
11630
|
+
// B-868 capability flag: `set-terminal-project` (same restamp discipline).
|
|
11631
|
+
terminalProjects: { rpcAvailable: true, detectedAt: now },
|
|
11561
11632
|
// B-084: closed records survive daemon restarts (persisted
|
|
11562
11633
|
// in closed-terminals.json), so the connect snapshot ships
|
|
11563
11634
|
// them too — not just the incremental pushes.
|