very-happy-cli 0.2.195 → 0.2.196
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-RqGkFeeY.mjs} +3 -3
- package/dist/{AcpBackend-CXSV6FF5.cjs → AcpBackend-tL_g_UJ5.cjs} +3 -3
- package/dist/{AcpSessionManager-CEpU_GVk.mjs → AcpSessionManager-C-R6yHXc.mjs} +2 -2
- package/dist/{AcpSessionManager-BbWODxSp.cjs → AcpSessionManager-CFB24qBh.cjs} +1 -1
- package/dist/{BasePermissionHandler-C6iF28Ct.cjs → BasePermissionHandler-C0JS37Jt.cjs} +1 -1
- package/dist/{BasePermissionHandler-B5ka7Aaf.mjs → BasePermissionHandler-CgHLVNKT.mjs} +1 -1
- package/dist/{account-Bvcdk9CH.cjs → account-DOil1Hn8.cjs} +5 -5
- package/dist/{account-WSJcdMGl.mjs → account-EzL-zwwE.mjs} +11 -11
- package/dist/{accountService-BtEgv0fC.mjs → accountService-DQ21IlBs.mjs} +4 -4
- package/dist/{acpSessionResume-B2hd1Wub.cjs → acpSessionResume-B01oHWDS.cjs} +1 -1
- package/dist/{acpSessionResume-BYMm4w8Q.mjs → acpSessionResume-DEOIZUuj.mjs} +1 -1
- package/dist/{agentHome-CVM15_3U.cjs → agentHome-BulDO_1K.cjs} +4 -4
- package/dist/{agentHome-Jl8yWAjF.mjs → agentHome-DucTue1n.mjs} +4 -4
- package/dist/{api-DOzNOoVJ.mjs → api-CiNezCys.mjs} +46 -13
- package/dist/{api-TpjZJXV-.cjs → api-fuwEEEkT.cjs} +45 -12
- package/dist/{apiMachine-COkvJAmd.cjs → apiMachine-CxmiSa2-.cjs} +13 -13
- package/dist/{apiMachine-M-Fs9g5Y.mjs → apiMachine-DCmKjms1.mjs} +18 -18
- package/dist/{attachmentContent-BiBOjTXX.cjs → attachmentContent-Cehh7ClR.cjs} +2 -2
- package/dist/{attachmentContent-D6PjMVDq.mjs → attachmentContent-CiY3MvdO.mjs} +2 -2
- package/dist/{auth-DfcdjMUp.cjs → auth-DHlbjtf7.cjs} +5 -5
- package/dist/{auth-BfHLe1gU.mjs → auth-DHqHrs5d.mjs} +8 -8
- package/dist/{auth-Bfe3Ue_B.mjs → auth-DVsH_a8J.mjs} +5 -5
- package/dist/{auth-BOceB8cL.cjs → auth-tlMcvk2Y.cjs} +8 -8
- package/dist/{auto-CDeivd5V.mjs → auto-Cnn8luKk.mjs} +17 -17
- package/dist/{auto-CnTitokD.cjs → auto-DNAa8xDZ.cjs} +14 -14
- package/dist/{bootstrap-BxcKrgR9.mjs → bootstrap-C2XSEyOe.mjs} +2 -2
- package/dist/{bootstrap-DpyP22Wx.cjs → bootstrap-PeTZ2sAn.cjs} +2 -2
- package/dist/{browser-ac0aPrVE.cjs → browser-Bm24RiFU.cjs} +1 -1
- package/dist/{browser-Bb0Gqffc.mjs → browser-CWWyaf8_.mjs} +1 -1
- package/dist/{claudeAccountEnv-NyoxjLuJ.mjs → claudeAccountEnv-CPO6CGNd.mjs} +1 -1
- package/dist/{claudeLocal-RGWhplSr.cjs → claudeLocal-BDWy2pFt.cjs} +4 -4
- package/dist/{claudeLocal-otwxWF6e.mjs → claudeLocal-CRG-Q7kS.mjs} +5 -5
- package/dist/{claudeLocalLauncher-CTibA4cU.mjs → claudeLocalLauncher-B5cOrszW.mjs} +10 -10
- package/dist/{claudeLocalLauncher-yG-MBhY7.cjs → claudeLocalLauncher-DmSLoHlw.cjs} +9 -9
- package/dist/{claudeSessionFork-HFFwivGY.mjs → claudeSessionFork-BqV6E0ep.mjs} +1 -1
- package/dist/{claudeSessionFork-DH_Su4uO.cjs → claudeSessionFork-OffWLYgd.cjs} +1 -1
- package/dist/{client-BhAjEv8Z.mjs → client-B3lOol4f.mjs} +4 -4
- package/dist/{client-BlV73Gbw.cjs → client-B9fcSMXP.cjs} +2 -2
- package/dist/{client-CydHzidF.mjs → client-CfTeXnYS.mjs} +2 -2
- package/dist/{client-DpTk1S7C.mjs → client-Cg_cuQb1.mjs} +2 -2
- package/dist/{client-DcXLNaF2.cjs → client-Ckic3nxZ.cjs} +2 -2
- package/dist/{client-DxjYsJ8d.cjs → client-YFvImdwH.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-C1xBSuVk.cjs → codexAppServerClient-C-UwVMUN.cjs} +3 -3
- package/dist/{codexAppServerClient-mln0W8vT.mjs → codexAppServerClient-aV5m-FpZ.mjs} +3 -3
- package/dist/{codexCommand-Plm-_aRy.cjs → codexCommand-5nWT7F8A.cjs} +48 -43
- package/dist/{codexCommand-CmWhYduF.mjs → codexCommand-CI2NTyIF.mjs} +54 -49
- package/dist/{codexTermination-QltAvFpq.mjs → codexTermination-CLjDP6Ja.mjs} +6 -2
- package/dist/{codexTermination-C9c80lIF.cjs → codexTermination-D18IHgLP.cjs} +6 -2
- package/dist/{config-BH75enfT.cjs → config-B7YtrHi0.cjs} +3 -3
- package/dist/{config-DK27kWTT.mjs → config-BfwjfFSC.mjs} +3 -3
- package/dist/{configuration-CwfgJZKs.mjs → configuration-C8r6uD9k.mjs} +1 -1
- package/dist/{configuration-CKaq0tNe.cjs → configuration-CWRKSOyj.cjs} +1 -1
- package/dist/{connect-_QkCFMxO.cjs → connect-DALX1hGB.cjs} +14 -14
- package/dist/{connect-h3_VMJst.mjs → connect-K5HBcM56.mjs} +15 -15
- package/dist/{context-DbENnaVc.cjs → context-BqhlGL3u.cjs} +1 -1
- package/dist/{context-DcOpvIiR.mjs → context-CtMY-M8T.mjs} +1 -1
- package/dist/{controlClient-Dv6IvvUq.mjs → controlClient-DYQ1g2ar.mjs} +19 -7
- package/dist/{controlClient-D_HIbnnS.cjs → controlClient-DyNgxNl7.cjs} +19 -7
- package/dist/{createSessionMetadata-CusO22Am.cjs → createSessionMetadata-C4WN8pVK.cjs} +2 -2
- package/dist/{createSessionMetadata-DimBsfVG.mjs → createSessionMetadata-CZuEDo2v.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-CMApF2Rl.mjs → deterministicJson-Dg_0QJAR.mjs} +13 -13
- package/dist/{deterministicJson-BYqRKTmL.cjs → deterministicJson-r4zhG546.cjs} +12 -12
- package/dist/{doctor-Czbl7gk2.cjs → doctor-0gLGzwz6.cjs} +8 -8
- package/dist/{doctor-u46qYYKX.cjs → doctor-CJpFhHoK.cjs} +8 -9
- package/dist/{doctor-BkyoZ0Uw.mjs → doctor-COeFzPpz.mjs} +8 -8
- package/dist/{doctor-BPkYWSuq.mjs → doctor-GN5mPOn5.mjs} +8 -9
- package/dist/{downloadTarget-C5BzZ_bz.cjs → downloadTarget-8ovVpDv1.cjs} +6 -6
- package/dist/{downloadTarget-CM0BZNSY.mjs → downloadTarget-CbuUiS5p.mjs} +6 -6
- package/dist/{ensureDaemonRunning-D508DmcP.cjs → ensureDaemonRunning-Bq-n6xTt.cjs} +5 -5
- package/dist/{ensureDaemonRunning-P399ot_C.mjs → ensureDaemonRunning-CwlujXmV.mjs} +5 -5
- package/dist/{handleResumeCommand-BK_2ShBf.mjs → handleResumeCommand-B5GgmPm_.mjs} +5 -5
- package/dist/{handleResumeCommand-CCgK7-0v.cjs → handleResumeCommand-muSrYA5y.cjs} +5 -5
- package/dist/{index-_DRVKtSd.mjs → index-BRH0XYSO.mjs} +53 -46
- package/dist/{index-BalJgriQ.cjs → index-BUOd8bNd.cjs} +5 -5
- package/dist/{index-BENDk1i9.mjs → index-BZCIkrFj.mjs} +4 -4
- package/dist/{index-BlWyEpMw.mjs → index-C27JFCbe.mjs} +1 -1
- package/dist/{index-CGKn-GTK.cjs → index-CQZg9jKx.cjs} +4 -4
- package/dist/{index-Bz9Bj7l1.cjs → index-CnY74Dae.cjs} +3 -3
- package/dist/{index-QSAckvNv.mjs → index-D0V-seiN.mjs} +3 -3
- package/dist/{index-DR3NJLVk.mjs → index-DKCmDned.mjs} +5 -5
- package/dist/{index-CSO1-mZ9.cjs → index-Dt_YE-zw.cjs} +47 -40
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-CqXaN7_C.cjs → install-BlW2kkPl.cjs} +3 -3
- package/dist/{install-DMTvEPrB.mjs → install-CooQf1oU.mjs} +3 -3
- package/dist/lib.cjs +16 -16
- package/dist/lib.d.cts +4 -0
- package/dist/lib.d.mts +4 -0
- package/dist/lib.mjs +16 -16
- package/dist/{lidState-Cb3TbhPb.mjs → lidState-BflRFw38.mjs} +1 -1
- package/dist/{lidState-Btv4N_B8.cjs → lidState-VZ1j_QYw.cjs} +1 -1
- package/dist/{localHappyAgentAuth-CAAIUJyY.mjs → localHappyAgentAuth-BAK_nqMG.mjs} +1 -1
- package/dist/{localHappyAgentAuth-B3Q5DNLR.cjs → localHappyAgentAuth-oxhpgJOb.cjs} +1 -1
- package/dist/{logger-UgDpJA2u.mjs → logger-D1hb3CG8.mjs} +2 -2
- package/dist/{logger-BZ5TcbEh.cjs → logger-HQ9yDb8R.cjs} +2 -2
- package/dist/{machineMetadata-BYHC-3Vx.mjs → machineMetadata-Dxng45Uh.mjs} +3 -3
- package/dist/{machineMetadata-DLb-m4fL.cjs → machineMetadata-Dzwn-HjN.cjs} +3 -3
- package/dist/{main-CwW6lHIw.mjs → main-BP0iY2vQ.mjs} +48 -48
- package/dist/{main-LavPb80B.cjs → main-D7qre-pa.cjs} +48 -48
- package/dist/{mcp-BjYz5Ymf.mjs → mcp-BmDGyj7k.mjs} +18 -18
- package/dist/{mcp-BQbWhqUh.cjs → mcp-D3yzLkh8.cjs} +14 -14
- package/dist/{mirrorProtocol-BH5eT99U.mjs → mirrorProtocol-C9Zc6GFT.mjs} +3 -3
- package/dist/{mirrorProtocol-Ci9YmCEV.cjs → mirrorProtocol-Cv2otcvM.cjs} +2 -2
- package/dist/{package-C4OfB2YF.mjs → package-CpmoMPuj.mjs} +7 -7
- package/dist/{package-B61-BBlh.cjs → package-Dn7zZkY1.cjs} +7 -7
- package/dist/{panels-cBJT5Up1.mjs → panels-CQobcX5w.mjs} +5 -5
- package/dist/{panels-ByprLJag.cjs → panels-D59PlNoD.cjs} +5 -5
- package/dist/{peerTools-DS6GqJcn.mjs → peerTools-CNzlwuL7.mjs} +5 -5
- package/dist/{peerTools-BXSjS8lB.cjs → peerTools-D417O7d-.cjs} +5 -5
- package/dist/{persistence-DBmeYlwT.cjs → persistence-BiyvEYaR.cjs} +15 -5
- package/dist/{persistence-CQhmtobL.mjs → persistence-CagHeZ-f.mjs} +15 -5
- package/dist/{piRunnerArgs-Dy-3vN_Q.mjs → piRunnerArgs-DKU5LoWu.mjs} +1 -1
- package/dist/{piRunnerArgs-CmEE058l.cjs → piRunnerArgs-kTaNYd23.cjs} +1 -1
- package/dist/{piRuntime-BCXjC4__.cjs → piRuntime-BI4KNAUY.cjs} +1 -1
- package/dist/{piRuntime-Rq9v4M4e.mjs → piRuntime-BV4fQyZD.mjs} +1 -1
- package/dist/{piTerminal-ehNQOvLL.cjs → piTerminal-WPUtDJAV.cjs} +16 -16
- package/dist/{piTerminal-CRhDUqX7.mjs → piTerminal-oObkl3WJ.mjs} +20 -20
- 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-67GmbVfE.mjs → pushNotifications-4sNESDMv.mjs} +11 -4
- package/dist/{pushNotifications-qCS7_tDF.cjs → pushNotifications-DRDWUnP-.cjs} +11 -2
- package/dist/{query-CIDBGnv6.mjs → query-6OWHW1U1.mjs} +2 -2
- package/dist/{query-B4QIiI7e.cjs → query-qIbeJ2-r.cjs} +2 -2
- package/dist/{rateLimitWindows-8-khalzj.mjs → rateLimitWindows-4uhuwKnU.mjs} +1 -1
- package/dist/{rateLimitWindows-BIfLMxOk.cjs → rateLimitWindows-U4fc1-_6.cjs} +1 -1
- package/dist/{registerCommonHandlers-G2p0MJu4.cjs → registerCommonHandlers-CEV9KUsq.cjs} +2 -2
- package/dist/{registerCommonHandlers-C7hlztAO.mjs → registerCommonHandlers-PTJ8TBj9.mjs} +2 -2
- package/dist/{registerKillSessionHandler-BWvl6wro.cjs → registerKillSessionHandler-C6F1sjoo.cjs} +5 -5
- package/dist/{registerKillSessionHandler-rwXdO0t0.mjs → registerKillSessionHandler-D4SSwQj8.mjs} +6 -6
- package/dist/{registerSideQuestionHandler-Xg46gSVh.mjs → registerSideQuestionHandler-4mRv0Msq.mjs} +4 -4
- package/dist/{registerSideQuestionHandler-CsyPnjce.cjs → registerSideQuestionHandler-ByUnjI3V.cjs} +4 -4
- package/dist/{remoteSessionClient-D6_7vNKc.cjs → remoteSessionClient-CUk6haD7.cjs} +5 -5
- package/dist/{remoteSessionClient-DQSnC7ox.mjs → remoteSessionClient-CfYDFlKm.mjs} +5 -5
- package/dist/{reportProgressTool-HjzV5y_2.mjs → reportProgressTool-BCn5oG52.mjs} +3 -3
- package/dist/{reportProgressTool-CIHGKraF.cjs → reportProgressTool-C1JOvo6T.cjs} +2 -2
- package/dist/{run-tQ4bFkHu.cjs → run-D2SlfZPP.cjs} +46 -66
- package/dist/{run-M06F1958.mjs → run-DC8BIklA.mjs} +52 -72
- package/dist/{runClaude-Ct0_mShC.cjs → runClaude-BE-5GgIZ.cjs} +29 -25
- package/dist/{runClaude-Dm9kQZ-w.mjs → runClaude-D6fqN9PD.mjs} +34 -30
- package/dist/{runClaudeDeps-DNOzXjc3.mjs → runClaudeDeps-BmdwskeI.mjs} +51 -50
- package/dist/{runClaudeDeps-BT2kWCrQ.cjs → runClaudeDeps-W0nv2vHL.cjs} +39 -38
- package/dist/{runGemini-BvN-yeQR.mjs → runGemini-C3Ipeu1i.mjs} +37 -34
- package/dist/{runGemini-cua7_iuR.cjs → runGemini-Da_d-2kV.cjs} +36 -33
- package/dist/{runOpenClaw-C9E2XzmX.mjs → runOpenClaw-BoI6nbKB.mjs} +30 -20
- package/dist/{runOpenClaw-NpYFRhKm.cjs → runOpenClaw-af5qDNU0.cjs} +30 -20
- package/dist/{sandbox-C-BXZbt9.mjs → sandbox-CjoyUSGa.mjs} +4 -4
- package/dist/{sandbox-hImfD0-T.cjs → sandbox-UGF68GrE.cjs} +4 -4
- package/dist/selfCheck-CNrOZgBv.mjs +88 -0
- package/dist/{selfCheck-B3ulijQM.cjs → selfCheck-Cr8eAw4m.cjs} +39 -39
- package/dist/{send-BCVQkTOl.cjs → send-CVSht9s_.cjs} +8 -8
- package/dist/{send-Dv2L8IRW.mjs → send-gqX0-i4p.mjs} +8 -8
- package/dist/{server-DYxyCyYF.cjs → server-BPgVv-BG.cjs} +6 -6
- package/dist/{server-BBBfuSB-.mjs → server-DxlNqWJo.mjs} +4 -4
- 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-BfvR9BGB.mjs} +94 -78
- package/dist/{sessionLock-B8fsnpZD.cjs → sessionLock-D2usWXAg.cjs} +92 -78
- package/dist/{sessionOps-74pSDXoS.cjs → sessionOps-JRyQhF5s.cjs} +4 -4
- package/dist/{sessionOps-BkEgNA2O.mjs → sessionOps-OmRqUFm4.mjs} +4 -4
- package/dist/{sessionProvider-CWgHsZUA.cjs → sessionProvider-BpscgwwC.cjs} +5 -5
- package/dist/{sessionProvider-DXkhlJE6.mjs → sessionProvider-DTEdidBc.mjs} +10 -10
- package/dist/{sessionScanner-Dhh1wREW.mjs → sessionScanner-BlAOpqMh.mjs} +3 -3
- package/dist/{sessionScanner-D56EkcIj.cjs → sessionScanner-C_qVc1ok.cjs} +3 -3
- package/dist/{sessions-C1zRTjUe.cjs → sessions-7iyjxti9.cjs} +10 -10
- package/dist/{sessions-dJR6k3JY.mjs → sessions-CnjHHllR.mjs} +10 -10
- package/dist/{setupOfflineReconnection-CMUdHtFT.cjs → setupOfflineReconnection-BCbJa5mT.cjs} +2 -2
- package/dist/{setupOfflineReconnection-Dp1rC-eP.mjs → setupOfflineReconnection-IKEI7fLJ.mjs} +2 -2
- package/dist/{spawn-D3-Weoiq.mjs → spawn-CbfcClhj.mjs} +14 -14
- package/dist/{spawn-kMKI09Kh.cjs → spawn-CxEl0Dyz.cjs} +12 -12
- package/dist/{spawnAgents-hKFGQaSJ.mjs → spawnAgents-N3jxdNJC.mjs} +1 -1
- package/dist/{spawnHappyCLI-CgjpjSTT.mjs → spawnHappyCLI-C8gMHJu5.mjs} +1 -1
- package/dist/{spawnHappyCLI-Du1IgJGA.cjs → spawnHappyCLI-CHSlXWUe.cjs} +1 -1
- package/dist/{startFileWatcher-DapvIGxp.mjs → startFileWatcher-6hslFu_B.mjs} +1 -1
- package/dist/{startFileWatcher-DGOnF95-.cjs → startFileWatcher-BGpYPz6L.cjs} +1 -1
- package/dist/{startupSessionCreate-CSi60oo_.mjs → startupSessionCreate-B7jrCZUD.mjs} +3 -3
- package/dist/{startupSessionCreate-rkIMVGJW.cjs → startupSessionCreate-CltDtCEF.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-Cj8Vhltg.cjs → sync-DfI78smj.cjs} +1 -1
- package/dist/{sync-GJkf-HGu.mjs → sync-DtzoF9sw.mjs} +1 -1
- package/dist/{systemPrompt-BEagRbDZ.mjs → systemPrompt-B1Xd99hK.mjs} +2 -2
- package/dist/{systemPrompt-Cne9i1SE.cjs → systemPrompt-HZNR9rjt.cjs} +1 -1
- package/dist/{teams-C_18IMNM.mjs → teams-Vk75H6BZ.mjs} +7 -7
- package/dist/{teams-ClTg6hQ1.cjs → teams-fFX-L_ms.cjs} +6 -6
- package/dist/{template-Ci-cyigF.mjs → template-CJ8uLlD8.mjs} +1 -1
- package/dist/{time-BPPTQ_sE.cjs → time-BqPZjTpo.cjs} +1 -1
- package/dist/{time-CIkdLyza.mjs → time-CgAwVt5R.mjs} +1 -1
- package/dist/{titleGenerator-DnwTdTB_.mjs → titleGenerator-D2UB7Uyr.mjs} +2 -2
- package/dist/{titleGenerator-B_OgL9Pd.cjs → titleGenerator-ijVOuv3J.cjs} +2 -2
- package/dist/{todo-DmHolFRy.mjs → todo-CCuqtD0O.mjs} +6 -6
- package/dist/{todo-DPQHtZVM.cjs → todo-vCzaIwNp.cjs} +5 -5
- package/dist/{tools-B3KGMSU5.cjs → tools-CL8h3fqh.cjs} +1 -1
- package/dist/{tools-DqjPHq9I.mjs → tools-DthGQoo3.mjs} +1 -1
- package/dist/{uninstall-CrK5dgx8.cjs → uninstall-CIvThBvI.cjs} +3 -3
- package/dist/{uninstall-Cm97eybp.mjs → uninstall-DCJh4UoO.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
|
@@ -4,13 +4,13 @@ var node_crypto = require('node:crypto');
|
|
|
4
4
|
var os = require('node:os');
|
|
5
5
|
var z = require('zod');
|
|
6
6
|
var ids = require('./ids-B6ZC0HGt.cjs');
|
|
7
|
-
var controlClient = require('./controlClient-
|
|
8
|
-
var persistence = require('./persistence-
|
|
9
|
-
var sessionOps = require('./sessionOps-
|
|
10
|
-
var remoteSessionClient = require('./remoteSessionClient-
|
|
7
|
+
var controlClient = require('./controlClient-DyNgxNl7.cjs');
|
|
8
|
+
var persistence = require('./persistence-BiyvEYaR.cjs');
|
|
9
|
+
var sessionOps = require('./sessionOps-JRyQhF5s.cjs');
|
|
10
|
+
var remoteSessionClient = require('./remoteSessionClient-CUk6haD7.cjs');
|
|
11
11
|
var node_fs = require('node:fs');
|
|
12
12
|
var path = require('node:path');
|
|
13
|
-
var client = require('./client-
|
|
13
|
+
var client = require('./client-Ckic3nxZ.cjs');
|
|
14
14
|
|
|
15
15
|
const SESSION_PEER_SENT_FROM = "session-peer";
|
|
16
16
|
const CLI_PEER_SENDER_ID = "cli";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var promises = require('node:fs/promises');
|
|
4
4
|
var node_fs = require('node:fs');
|
|
5
|
-
var configuration = require('./configuration-
|
|
5
|
+
var configuration = require('./configuration-CWRKSOyj.cjs');
|
|
6
6
|
var z = require('zod');
|
|
7
7
|
var authRelay = require('./authRelay-Dy1qU9td.cjs');
|
|
8
|
-
var logger = require('./logger-
|
|
8
|
+
var logger = require('./logger-HQ9yDb8R.cjs');
|
|
9
9
|
|
|
10
10
|
function _interopNamespaceDefault(e) {
|
|
11
11
|
var n = Object.create(null);
|
|
@@ -344,11 +344,21 @@ async function readDaemonState() {
|
|
|
344
344
|
function writeDaemonState(state) {
|
|
345
345
|
configuration.writePrivateFileSync(configuration.configuration.daemonStateFile, JSON.stringify(state, null, 2));
|
|
346
346
|
}
|
|
347
|
-
|
|
347
|
+
function daemonLockPid() {
|
|
348
|
+
try {
|
|
349
|
+
const pid = Number.parseInt(node_fs.readFileSync(configuration.configuration.daemonLockFile, "utf-8").trim(), 10);
|
|
350
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
351
|
+
} catch {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
async function clearDaemonState(ownerPid) {
|
|
348
356
|
if (node_fs.existsSync(configuration.configuration.daemonStateFile)) {
|
|
349
|
-
await
|
|
357
|
+
const owner = ownerPid === void 0 ? null : (await readDaemonState())?.pid ?? null;
|
|
358
|
+
if (ownerPid === void 0 || owner === null || owner === ownerPid) await promises.unlink(configuration.configuration.daemonStateFile);
|
|
350
359
|
}
|
|
351
360
|
if (node_fs.existsSync(configuration.configuration.daemonLockFile)) {
|
|
361
|
+
if (ownerPid !== void 0 && daemonLockPid() !== ownerPid) return;
|
|
352
362
|
try {
|
|
353
363
|
await promises.unlink(configuration.configuration.daemonLockFile);
|
|
354
364
|
} catch {
|
|
@@ -395,7 +405,7 @@ async function releaseDaemonLock(lockHandle) {
|
|
|
395
405
|
} catch {
|
|
396
406
|
}
|
|
397
407
|
try {
|
|
398
|
-
if (node_fs.existsSync(configuration.configuration.daemonLockFile)) {
|
|
408
|
+
if (node_fs.existsSync(configuration.configuration.daemonLockFile) && daemonLockPid() === process.pid) {
|
|
399
409
|
node_fs.unlinkSync(configuration.configuration.daemonLockFile);
|
|
400
410
|
}
|
|
401
411
|
} catch {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { readFile, open, unlink, stat, rename } from 'node:fs/promises';
|
|
2
2
|
import { existsSync, constants, readFileSync, unlinkSync, renameSync } from 'node:fs';
|
|
3
|
-
import { c as configuration, P as PRIVATE_FILE_MODE, w as writePrivateFileSync, a as hardenPrivateFileSync, e as ensurePrivateDirectory, b as writePrivateFile, h as hardenPrivateFile } from './configuration-
|
|
3
|
+
import { c as configuration, P as PRIVATE_FILE_MODE, w as writePrivateFileSync, a as hardenPrivateFileSync, e as ensurePrivateDirectory, b as writePrivateFile, h as hardenPrivateFile } from './configuration-C8r6uD9k.mjs';
|
|
4
4
|
import * as z from 'zod';
|
|
5
5
|
import { c as credentialRelayProblem, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
6
|
-
import { l as logger } from './logger-
|
|
6
|
+
import { l as logger } from './logger-D1hb3CG8.mjs';
|
|
7
7
|
|
|
8
8
|
const HIBERNATION_CAPABILITY = "agent-hibernation-v1";
|
|
9
9
|
const HOUR_MS = 60 * 60 * 1e3;
|
|
@@ -323,11 +323,21 @@ async function readDaemonState() {
|
|
|
323
323
|
function writeDaemonState(state) {
|
|
324
324
|
writePrivateFileSync(configuration.daemonStateFile, JSON.stringify(state, null, 2));
|
|
325
325
|
}
|
|
326
|
-
|
|
326
|
+
function daemonLockPid() {
|
|
327
|
+
try {
|
|
328
|
+
const pid = Number.parseInt(readFileSync(configuration.daemonLockFile, "utf-8").trim(), 10);
|
|
329
|
+
return Number.isInteger(pid) && pid > 0 ? pid : null;
|
|
330
|
+
} catch {
|
|
331
|
+
return null;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
async function clearDaemonState(ownerPid) {
|
|
327
335
|
if (existsSync(configuration.daemonStateFile)) {
|
|
328
|
-
await
|
|
336
|
+
const owner = ownerPid === void 0 ? null : (await readDaemonState())?.pid ?? null;
|
|
337
|
+
if (ownerPid === void 0 || owner === null || owner === ownerPid) await unlink(configuration.daemonStateFile);
|
|
329
338
|
}
|
|
330
339
|
if (existsSync(configuration.daemonLockFile)) {
|
|
340
|
+
if (ownerPid !== void 0 && daemonLockPid() !== ownerPid) return;
|
|
331
341
|
try {
|
|
332
342
|
await unlink(configuration.daemonLockFile);
|
|
333
343
|
} catch {
|
|
@@ -374,7 +384,7 @@ async function releaseDaemonLock(lockHandle) {
|
|
|
374
384
|
} catch {
|
|
375
385
|
}
|
|
376
386
|
try {
|
|
377
|
-
if (existsSync(configuration.daemonLockFile)) {
|
|
387
|
+
if (existsSync(configuration.daemonLockFile) && daemonLockPid() === process.pid) {
|
|
378
388
|
unlinkSync(configuration.daemonLockFile);
|
|
379
389
|
}
|
|
380
390
|
} catch {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as sanitizeAgentSessionId, n as normalizeAcpPermissionMode } from './acpSessionResume-
|
|
1
|
+
import { s as sanitizeAgentSessionId, n as normalizeAcpPermissionMode } from './acpSessionResume-DEOIZUuj.mjs';
|
|
2
2
|
|
|
3
3
|
function sanitizeSpawnModel(value) {
|
|
4
4
|
if (typeof value !== "string") return null;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var promises = require('node:fs/promises');
|
|
4
4
|
var node_crypto = require('node:crypto');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var configuration = require('./configuration-
|
|
6
|
+
var configuration = require('./configuration-CWRKSOyj.cjs');
|
|
7
7
|
var resources = require('./resources-BZ_Be0qM.cjs');
|
|
8
8
|
|
|
9
9
|
async function publish(path, content, mode) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mkdir, chmod, writeFile, rename } from 'node:fs/promises';
|
|
2
2
|
import { randomUUID } from 'node:crypto';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { c as configuration } from './configuration-
|
|
4
|
+
import { c as configuration } from './configuration-C8r6uD9k.mjs';
|
|
5
5
|
import { P as PI_TEAMS_EXTENSION } from './resources-CLP_MpK4.mjs';
|
|
6
6
|
|
|
7
7
|
async function publish(path, content, mode) {
|
|
@@ -5,15 +5,15 @@ var node_crypto = require('node:crypto');
|
|
|
5
5
|
var node_http = require('node:http');
|
|
6
6
|
var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
7
7
|
var streamableHttp_js = require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
8
|
-
var piRuntime = require('./piRuntime-
|
|
9
|
-
var mcp = require('./mcp-
|
|
8
|
+
var piRuntime = require('./piRuntime-BI4KNAUY.cjs');
|
|
9
|
+
var mcp = require('./mcp-D3yzLkh8.cjs');
|
|
10
10
|
require('./agentGuidance-BtBx2xxE.cjs');
|
|
11
11
|
require('node:fs/promises');
|
|
12
12
|
require('node:os');
|
|
13
13
|
require('zod');
|
|
14
|
-
require('./logger-
|
|
15
|
-
require('./persistence-
|
|
16
|
-
require('./configuration-
|
|
14
|
+
require('./logger-HQ9yDb8R.cjs');
|
|
15
|
+
require('./persistence-BiyvEYaR.cjs');
|
|
16
|
+
require('./configuration-CWRKSOyj.cjs');
|
|
17
17
|
require('axios');
|
|
18
18
|
require('tweetnacl');
|
|
19
19
|
require('socket.io-client');
|
|
@@ -22,27 +22,27 @@ require('node:fs');
|
|
|
22
22
|
require('node:path');
|
|
23
23
|
var terminalToolContext = require('./terminalToolContext-DoV9Gs7K.cjs');
|
|
24
24
|
require('./resources-BZ_Be0qM.cjs');
|
|
25
|
-
require('./tools-
|
|
26
|
-
require('./client-
|
|
25
|
+
require('./tools-CL8h3fqh.cjs');
|
|
26
|
+
require('./client-YFvImdwH.cjs');
|
|
27
27
|
require('node:util');
|
|
28
28
|
require('./index-D9Hidq-g.cjs');
|
|
29
29
|
require('@paralleldrive/cuid2');
|
|
30
|
-
require('./context-
|
|
30
|
+
require('./context-BqhlGL3u.cjs');
|
|
31
31
|
require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
32
|
-
require('./controlClient-
|
|
32
|
+
require('./controlClient-DyNgxNl7.cjs');
|
|
33
33
|
require('./limits-C-a7gr04.cjs');
|
|
34
|
-
require('./downloadTarget-
|
|
35
|
-
require('./sessionOps-
|
|
34
|
+
require('./downloadTarget-8ovVpDv1.cjs');
|
|
35
|
+
require('./sessionOps-JRyQhF5s.cjs');
|
|
36
36
|
require('./authRelay-Dy1qU9td.cjs');
|
|
37
|
-
require('./time-
|
|
37
|
+
require('./time-BqPZjTpo.cjs');
|
|
38
38
|
require('./specialCommands-J3JFOq0J.cjs');
|
|
39
39
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
40
|
-
require('./remoteSessionClient-
|
|
40
|
+
require('./remoteSessionClient-CUk6haD7.cjs');
|
|
41
41
|
require('./ids-B6ZC0HGt.cjs');
|
|
42
|
-
require('./bootstrap-
|
|
42
|
+
require('./bootstrap-PeTZ2sAn.cjs');
|
|
43
43
|
require('./previewPath-B0rBdhy1.cjs');
|
|
44
44
|
require('./terminalTitleSuggest-DhvRFX3H.cjs');
|
|
45
|
-
require('./titleGenerator-
|
|
45
|
+
require('./titleGenerator-ijVOuv3J.cjs');
|
|
46
46
|
require('node:module');
|
|
47
47
|
require('./oneShotPrompts-CL0dip9C.cjs');
|
|
48
48
|
require('./projectPath-C3ioB4Bu.cjs');
|
|
@@ -53,7 +53,7 @@ require('./claudeAccountEnv-_O3x5AJ1.cjs');
|
|
|
53
53
|
require('./store-aa3CVNwS.cjs');
|
|
54
54
|
require('./trimIdent-4gvk9Wk6.cjs');
|
|
55
55
|
require('chalk');
|
|
56
|
-
require('./package-
|
|
56
|
+
require('./package-Dn7zZkY1.cjs');
|
|
57
57
|
require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
58
58
|
|
|
59
59
|
async function startPiTerminalTools(terminalId) {
|
|
@@ -3,15 +3,15 @@ import { randomUUID } from 'node:crypto';
|
|
|
3
3
|
import { createServer } from 'node:http';
|
|
4
4
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
5
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
6
|
-
import { p as preparePiTeamsRuntime } from './piRuntime-
|
|
7
|
-
import { registerMcpTools, registerTerminalTitleSuggest } from './mcp-
|
|
6
|
+
import { p as preparePiTeamsRuntime } from './piRuntime-BV4fQyZD.mjs';
|
|
7
|
+
import { registerMcpTools, registerTerminalTitleSuggest } from './mcp-BmDGyj7k.mjs';
|
|
8
8
|
import './agentGuidance-BDYt2Qy2.mjs';
|
|
9
9
|
import 'node:fs/promises';
|
|
10
10
|
import 'node:os';
|
|
11
11
|
import 'zod';
|
|
12
|
-
import './logger-
|
|
13
|
-
import './persistence-
|
|
14
|
-
import './configuration-
|
|
12
|
+
import './logger-D1hb3CG8.mjs';
|
|
13
|
+
import './persistence-CagHeZ-f.mjs';
|
|
14
|
+
import './configuration-C8r6uD9k.mjs';
|
|
15
15
|
import 'axios';
|
|
16
16
|
import 'tweetnacl';
|
|
17
17
|
import 'socket.io-client';
|
|
@@ -20,38 +20,38 @@ import 'node:fs';
|
|
|
20
20
|
import 'node:path';
|
|
21
21
|
import { r as resolveMcpTerminalId } from './terminalToolContext-CFeGeaNm.mjs';
|
|
22
22
|
import './resources-CLP_MpK4.mjs';
|
|
23
|
-
import './tools-
|
|
24
|
-
import './client-
|
|
23
|
+
import './tools-DthGQoo3.mjs';
|
|
24
|
+
import './client-B3lOol4f.mjs';
|
|
25
25
|
import 'node:util';
|
|
26
|
-
import './index-
|
|
26
|
+
import './index-C27JFCbe.mjs';
|
|
27
27
|
import '@paralleldrive/cuid2';
|
|
28
|
-
import './context-
|
|
28
|
+
import './context-CtMY-M8T.mjs';
|
|
29
29
|
import '@modelcontextprotocol/sdk/server/stdio.js';
|
|
30
|
-
import './controlClient-
|
|
30
|
+
import './controlClient-DYQ1g2ar.mjs';
|
|
31
31
|
import './limits-DIo7rEBR.mjs';
|
|
32
|
-
import './downloadTarget-
|
|
33
|
-
import './sessionOps-
|
|
32
|
+
import './downloadTarget-CbuUiS5p.mjs';
|
|
33
|
+
import './sessionOps-OmRqUFm4.mjs';
|
|
34
34
|
import './authRelay-DhQhkBvX.mjs';
|
|
35
|
-
import './time-
|
|
35
|
+
import './time-CgAwVt5R.mjs';
|
|
36
36
|
import './specialCommands-MXUN0wfI.mjs';
|
|
37
37
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
38
|
-
import './remoteSessionClient-
|
|
38
|
+
import './remoteSessionClient-CfYDFlKm.mjs';
|
|
39
39
|
import './ids-DU6sLx4C.mjs';
|
|
40
|
-
import './bootstrap-
|
|
40
|
+
import './bootstrap-C2XSEyOe.mjs';
|
|
41
41
|
import './previewPath-CXN4Vag0.mjs';
|
|
42
42
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
43
|
-
import './titleGenerator-
|
|
43
|
+
import './titleGenerator-D2UB7Uyr.mjs';
|
|
44
44
|
import 'node:module';
|
|
45
45
|
import './oneShotPrompts-DT4p6RNd.mjs';
|
|
46
46
|
import './projectPath-BTBIMB57.mjs';
|
|
47
47
|
import 'path';
|
|
48
48
|
import 'url';
|
|
49
|
-
import './wrapperAccount-
|
|
50
|
-
import './claudeAccountEnv-
|
|
51
|
-
import './store-
|
|
49
|
+
import './wrapperAccount-RPtq8BwD.mjs';
|
|
50
|
+
import './claudeAccountEnv-CPO6CGNd.mjs';
|
|
51
|
+
import './store-BlPvTr_Q.mjs';
|
|
52
52
|
import './trimIdent-BAjmv_TG.mjs';
|
|
53
53
|
import 'chalk';
|
|
54
|
-
import './package-
|
|
54
|
+
import './package-CpmoMPuj.mjs';
|
|
55
55
|
import './tmuxSocket-B8Yx20sT.mjs';
|
|
56
56
|
|
|
57
57
|
async function startPiTerminalTools(terminalId) {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { s as snapshotTree, k as killSurvivors, r as readLiveProcessTable, a as survivorsOf } from './processTreeSnapshot-fuwxC0fr.mjs';
|
|
3
|
+
|
|
4
|
+
function isProcessAlive(pid, kill = (p, s) => {
|
|
5
|
+
process.kill(p, s);
|
|
6
|
+
}) {
|
|
7
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
8
|
+
try {
|
|
9
|
+
kill(pid, 0);
|
|
10
|
+
return true;
|
|
11
|
+
} catch (error) {
|
|
12
|
+
return error?.code === "EPERM";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const runtime = {
|
|
16
|
+
signal: (pid, signal) => process.kill(pid, signal),
|
|
17
|
+
isAlive: (pid) => isProcessAlive(pid),
|
|
18
|
+
schedule: (callback, delayMs) => {
|
|
19
|
+
setTimeout(callback, delayMs);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function terminateProcess(pid, onSettled, impl = runtime, graceMs = 2e3, hooks = {}) {
|
|
23
|
+
if (!impl.isAlive(pid)) {
|
|
24
|
+
onSettled(true);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
impl.signal(pid, "SIGTERM");
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
impl.schedule(() => {
|
|
33
|
+
if (impl.isAlive(pid)) {
|
|
34
|
+
try {
|
|
35
|
+
hooks.beforeKill?.();
|
|
36
|
+
} catch {
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
impl.signal(pid, "SIGKILL");
|
|
40
|
+
} catch {
|
|
41
|
+
onSettled(!impl.isAlive(pid));
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
impl.schedule(() => onSettled(!impl.isAlive(pid)), 100);
|
|
46
|
+
}, graceMs);
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const TREE_VERIFY_ATTEMPTS = 20;
|
|
50
|
+
const TREE_VERIFY_INTERVAL_MS = 100;
|
|
51
|
+
const windowsTreeRuntime = (base) => ({
|
|
52
|
+
...base,
|
|
53
|
+
signal: (pid, signal) => {
|
|
54
|
+
const result = spawnSync("taskkill", ["/pid", String(pid), "/t", "/f"], { stdio: "ignore", windowsHide: true, timeout: 5e3 });
|
|
55
|
+
if (result.status !== 0 && base.isAlive(pid)) base.signal(pid, signal);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
function terminateProcessTree(pid, onSettled, deps = {}) {
|
|
59
|
+
const snapshot = deps.snapshot ?? ((root) => snapshotTree(root));
|
|
60
|
+
const reap = deps.reap ?? ((entries) => killSurvivors(entries));
|
|
61
|
+
const readLive = deps.readLive ?? readLiveProcessTable;
|
|
62
|
+
const base = deps.runtime ?? runtime;
|
|
63
|
+
const impl = (deps.platform ?? process.platform) === "win32" ? windowsTreeRuntime(base) : base;
|
|
64
|
+
const members = /* @__PURE__ */ new Map();
|
|
65
|
+
const remember = () => {
|
|
66
|
+
try {
|
|
67
|
+
for (const entry of snapshot(pid)) members.set(`${entry.pid}@${entry.start}`, entry);
|
|
68
|
+
} catch {
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
remember();
|
|
72
|
+
return (deps.terminate ?? terminateProcess)(pid, (stopped) => {
|
|
73
|
+
const tree = [...members.values()];
|
|
74
|
+
let attempt = 0;
|
|
75
|
+
const verify = () => {
|
|
76
|
+
try {
|
|
77
|
+
reap(tree);
|
|
78
|
+
} catch {
|
|
79
|
+
}
|
|
80
|
+
if (tree.length === 0) {
|
|
81
|
+
onSettled(stopped);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let table = null;
|
|
85
|
+
try {
|
|
86
|
+
table = readLive();
|
|
87
|
+
} catch {
|
|
88
|
+
table = null;
|
|
89
|
+
}
|
|
90
|
+
const left = table ? survivorsOf(tree, table).filter((entry) => entry.pid !== process.pid) : [];
|
|
91
|
+
if (left.length === 0) {
|
|
92
|
+
onSettled(stopped);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
attempt += 1;
|
|
96
|
+
if (attempt >= TREE_VERIFY_ATTEMPTS) {
|
|
97
|
+
deps.onLeftovers?.(left.map((entry) => entry.pid));
|
|
98
|
+
onSettled(false);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
impl.schedule(verify, TREE_VERIFY_INTERVAL_MS);
|
|
102
|
+
};
|
|
103
|
+
verify();
|
|
104
|
+
}, impl, deps.graceMs ?? 2e3, { beforeKill: remember });
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export { isProcessAlive as i, terminateProcessTree as t };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_child_process = require('node:child_process');
|
|
4
|
+
var processTreeSnapshot = require('./processTreeSnapshot-D5iNblp6.cjs');
|
|
5
|
+
|
|
6
|
+
function isProcessAlive(pid, kill = (p, s) => {
|
|
7
|
+
process.kill(p, s);
|
|
8
|
+
}) {
|
|
9
|
+
if (!Number.isInteger(pid) || pid <= 0) return false;
|
|
10
|
+
try {
|
|
11
|
+
kill(pid, 0);
|
|
12
|
+
return true;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return error?.code === "EPERM";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const runtime = {
|
|
18
|
+
signal: (pid, signal) => process.kill(pid, signal),
|
|
19
|
+
isAlive: (pid) => isProcessAlive(pid),
|
|
20
|
+
schedule: (callback, delayMs) => {
|
|
21
|
+
setTimeout(callback, delayMs);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
function terminateProcess(pid, onSettled, impl = runtime, graceMs = 2e3, hooks = {}) {
|
|
25
|
+
if (!impl.isAlive(pid)) {
|
|
26
|
+
onSettled(true);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
impl.signal(pid, "SIGTERM");
|
|
31
|
+
} catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
impl.schedule(() => {
|
|
35
|
+
if (impl.isAlive(pid)) {
|
|
36
|
+
try {
|
|
37
|
+
hooks.beforeKill?.();
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
impl.signal(pid, "SIGKILL");
|
|
42
|
+
} catch {
|
|
43
|
+
onSettled(!impl.isAlive(pid));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
impl.schedule(() => onSettled(!impl.isAlive(pid)), 100);
|
|
48
|
+
}, graceMs);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
const TREE_VERIFY_ATTEMPTS = 20;
|
|
52
|
+
const TREE_VERIFY_INTERVAL_MS = 100;
|
|
53
|
+
const windowsTreeRuntime = (base) => ({
|
|
54
|
+
...base,
|
|
55
|
+
signal: (pid, signal) => {
|
|
56
|
+
const result = node_child_process.spawnSync("taskkill", ["/pid", String(pid), "/t", "/f"], { stdio: "ignore", windowsHide: true, timeout: 5e3 });
|
|
57
|
+
if (result.status !== 0 && base.isAlive(pid)) base.signal(pid, signal);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
function terminateProcessTree(pid, onSettled, deps = {}) {
|
|
61
|
+
const snapshot = deps.snapshot ?? ((root) => processTreeSnapshot.snapshotTree(root));
|
|
62
|
+
const reap = deps.reap ?? ((entries) => processTreeSnapshot.killSurvivors(entries));
|
|
63
|
+
const readLive = deps.readLive ?? processTreeSnapshot.readLiveProcessTable;
|
|
64
|
+
const base = deps.runtime ?? runtime;
|
|
65
|
+
const impl = (deps.platform ?? process.platform) === "win32" ? windowsTreeRuntime(base) : base;
|
|
66
|
+
const members = /* @__PURE__ */ new Map();
|
|
67
|
+
const remember = () => {
|
|
68
|
+
try {
|
|
69
|
+
for (const entry of snapshot(pid)) members.set(`${entry.pid}@${entry.start}`, entry);
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
remember();
|
|
74
|
+
return (deps.terminate ?? terminateProcess)(pid, (stopped) => {
|
|
75
|
+
const tree = [...members.values()];
|
|
76
|
+
let attempt = 0;
|
|
77
|
+
const verify = () => {
|
|
78
|
+
try {
|
|
79
|
+
reap(tree);
|
|
80
|
+
} catch {
|
|
81
|
+
}
|
|
82
|
+
if (tree.length === 0) {
|
|
83
|
+
onSettled(stopped);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
let table = null;
|
|
87
|
+
try {
|
|
88
|
+
table = readLive();
|
|
89
|
+
} catch {
|
|
90
|
+
table = null;
|
|
91
|
+
}
|
|
92
|
+
const left = table ? processTreeSnapshot.survivorsOf(tree, table).filter((entry) => entry.pid !== process.pid) : [];
|
|
93
|
+
if (left.length === 0) {
|
|
94
|
+
onSettled(stopped);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
attempt += 1;
|
|
98
|
+
if (attempt >= TREE_VERIFY_ATTEMPTS) {
|
|
99
|
+
deps.onLeftovers?.(left.map((entry) => entry.pid));
|
|
100
|
+
onSettled(false);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
impl.schedule(verify, TREE_VERIFY_INTERVAL_MS);
|
|
104
|
+
};
|
|
105
|
+
verify();
|
|
106
|
+
}, impl, deps.graceMs ?? 2e3, { beforeKill: remember });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
exports.isProcessAlive = isProcessAlive;
|
|
110
|
+
exports.terminateProcessTree = terminateProcessTree;
|
|
@@ -27,6 +27,30 @@ const readProcessTable = () => {
|
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
+
function parseLiveProcessTable(stdout) {
|
|
31
|
+
const entries = [];
|
|
32
|
+
for (const line of stdout.split("\n")) {
|
|
33
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(.+?)\s*$/.exec(line);
|
|
34
|
+
if (!match || match[3].startsWith("Z")) continue;
|
|
35
|
+
entries.push({ pid: Number(match[1]), ppid: Number(match[2]), start: match[4] });
|
|
36
|
+
}
|
|
37
|
+
return entries;
|
|
38
|
+
}
|
|
39
|
+
const readLiveProcessTable = () => {
|
|
40
|
+
if (process.platform === "win32") return null;
|
|
41
|
+
try {
|
|
42
|
+
const result = node_child_process.spawnSync("ps", ["-A", "-o", "pid=,ppid=,stat=,lstart="], {
|
|
43
|
+
encoding: "utf8",
|
|
44
|
+
timeout: 3e3,
|
|
45
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
46
|
+
env: { ...process.env, LC_ALL: "C", LANG: "C" }
|
|
47
|
+
});
|
|
48
|
+
if (result.status !== 0 || typeof result.stdout !== "string") return null;
|
|
49
|
+
return parseLiveProcessTable(result.stdout);
|
|
50
|
+
} catch {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
30
54
|
function descendantsOf(rootPid, table) {
|
|
31
55
|
const children = /* @__PURE__ */ new Map();
|
|
32
56
|
for (const entry of table) {
|
|
@@ -101,5 +125,7 @@ async function terminateSurvivors(snapshot, options = {}) {
|
|
|
101
125
|
}
|
|
102
126
|
|
|
103
127
|
exports.killSurvivors = killSurvivors;
|
|
128
|
+
exports.readLiveProcessTable = readLiveProcessTable;
|
|
104
129
|
exports.snapshotTree = snapshotTree;
|
|
130
|
+
exports.survivorsOf = survivorsOf;
|
|
105
131
|
exports.terminateSurvivors = terminateSurvivors;
|
|
@@ -25,6 +25,30 @@ const readProcessTable = () => {
|
|
|
25
25
|
return null;
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
+
function parseLiveProcessTable(stdout) {
|
|
29
|
+
const entries = [];
|
|
30
|
+
for (const line of stdout.split("\n")) {
|
|
31
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(\S+)\s+(.+?)\s*$/.exec(line);
|
|
32
|
+
if (!match || match[3].startsWith("Z")) continue;
|
|
33
|
+
entries.push({ pid: Number(match[1]), ppid: Number(match[2]), start: match[4] });
|
|
34
|
+
}
|
|
35
|
+
return entries;
|
|
36
|
+
}
|
|
37
|
+
const readLiveProcessTable = () => {
|
|
38
|
+
if (process.platform === "win32") return null;
|
|
39
|
+
try {
|
|
40
|
+
const result = spawnSync("ps", ["-A", "-o", "pid=,ppid=,stat=,lstart="], {
|
|
41
|
+
encoding: "utf8",
|
|
42
|
+
timeout: 3e3,
|
|
43
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
44
|
+
env: { ...process.env, LC_ALL: "C", LANG: "C" }
|
|
45
|
+
});
|
|
46
|
+
if (result.status !== 0 || typeof result.stdout !== "string") return null;
|
|
47
|
+
return parseLiveProcessTable(result.stdout);
|
|
48
|
+
} catch {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
28
52
|
function descendantsOf(rootPid, table) {
|
|
29
53
|
const children = /* @__PURE__ */ new Map();
|
|
30
54
|
for (const entry of table) {
|
|
@@ -98,4 +122,4 @@ async function terminateSurvivors(snapshot, options = {}) {
|
|
|
98
122
|
if (alive.length > 0) killSurvivors(alive, { read, kill });
|
|
99
123
|
}
|
|
100
124
|
|
|
101
|
-
export { killSurvivors as k, snapshotTree as s, terminateSurvivors as t };
|
|
125
|
+
export { survivorsOf as a, killSurvivors as k, readLiveProcessTable as r, snapshotTree as s, terminateSurvivors as t };
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
+
import { Q as AgentProfilesStateSchema, T as AgentVersionsSchema } from './index-C27JFCbe.mjs';
|
|
3
4
|
import axios from 'axios';
|
|
4
|
-
import { l as logger } from './logger-
|
|
5
|
-
import { c as configuration } from './configuration-
|
|
5
|
+
import { l as logger } from './logger-D1hb3CG8.mjs';
|
|
6
|
+
import { c as configuration } from './configuration-C8r6uD9k.mjs';
|
|
6
7
|
import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
7
8
|
|
|
9
|
+
const agentInstanceAuth = Object.freeze({
|
|
10
|
+
agentInstance: randomUUID(),
|
|
11
|
+
agentStartedAt: Math.floor(performance.timeOrigin)
|
|
12
|
+
});
|
|
13
|
+
const SESSION_SUPERSEDED_ERROR = "Session superseded";
|
|
14
|
+
|
|
8
15
|
z.object({
|
|
9
16
|
teamsVersion: z.number().int().positive().optional(),
|
|
10
17
|
teamLaunchVersion: z.number().int().positive().optional(),
|
|
@@ -722,4 +729,4 @@ class PushNotificationClient {
|
|
|
722
729
|
}
|
|
723
730
|
}
|
|
724
731
|
|
|
725
|
-
export { AsyncLock as A, FileEventMessageSchema as F, MAX_CHAT_ATTACHMENT_SOURCE_BYTES as M, PushNotificationClient as P, UserMessageSchema as U,
|
|
732
|
+
export { AsyncLock as A, FileEventMessageSchema as F, MAX_CHAT_ATTACHMENT_SOURCE_BYTES as M, PushNotificationClient as P, SESSION_SUPERSEDED_ERROR as S, UserMessageSchema as U, agentInstanceAuth as a, MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES as b, getSessionNotificationBody as g };
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var node_crypto = require('node:crypto');
|
|
3
4
|
var z = require('zod');
|
|
4
5
|
var index = require('./index-D9Hidq-g.cjs');
|
|
5
6
|
var axios = require('axios');
|
|
6
|
-
var logger = require('./logger-
|
|
7
|
-
var configuration = require('./configuration-
|
|
7
|
+
var logger = require('./logger-HQ9yDb8R.cjs');
|
|
8
|
+
var configuration = require('./configuration-CWRKSOyj.cjs');
|
|
8
9
|
var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
9
10
|
|
|
11
|
+
const agentInstanceAuth = Object.freeze({
|
|
12
|
+
agentInstance: node_crypto.randomUUID(),
|
|
13
|
+
agentStartedAt: Math.floor(performance.timeOrigin)
|
|
14
|
+
});
|
|
15
|
+
const SESSION_SUPERSEDED_ERROR = "Session superseded";
|
|
16
|
+
|
|
10
17
|
z.z.object({
|
|
11
18
|
teamsVersion: z.z.number().int().positive().optional(),
|
|
12
19
|
teamLaunchVersion: z.z.number().int().positive().optional(),
|
|
@@ -729,5 +736,7 @@ exports.FileEventMessageSchema = FileEventMessageSchema;
|
|
|
729
736
|
exports.MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES = MAX_CHAT_ATTACHMENT_ENCRYPTED_BYTES;
|
|
730
737
|
exports.MAX_CHAT_ATTACHMENT_SOURCE_BYTES = MAX_CHAT_ATTACHMENT_SOURCE_BYTES;
|
|
731
738
|
exports.PushNotificationClient = PushNotificationClient;
|
|
739
|
+
exports.SESSION_SUPERSEDED_ERROR = SESSION_SUPERSEDED_ERROR;
|
|
732
740
|
exports.UserMessageSchema = UserMessageSchema;
|
|
741
|
+
exports.agentInstanceAuth = agentInstanceAuth;
|
|
733
742
|
exports.getSessionNotificationBody = getSessionNotificationBody;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { query as query$1 } from '@anthropic-ai/claude-agent-sdk';
|
|
2
2
|
import { p as pinSmallFastModel, a as applyPromptCacheTtlDefault, e as ensureLocalProxyBypass } from './promptCacheTtl-Ce0TVbrx.mjs';
|
|
3
|
-
import { l as logger } from './logger-
|
|
4
|
-
import { s as snapshotTree, k as killSurvivors } from './processTreeSnapshot-
|
|
3
|
+
import { l as logger } from './logger-D1hb3CG8.mjs';
|
|
4
|
+
import { s as snapshotTree, k as killSurvivors } from './processTreeSnapshot-fuwxC0fr.mjs';
|
|
5
5
|
|
|
6
6
|
const HAPPY_DEFAULT_ENTRYPOINT = "remote_mobile";
|
|
7
7
|
function resolveHappyEntrypoint(currentValue) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
|
|
4
4
|
var promptCacheTtl = require('./promptCacheTtl-B8PCzE6k.cjs');
|
|
5
|
-
var logger = require('./logger-
|
|
6
|
-
var processTreeSnapshot = require('./processTreeSnapshot-
|
|
5
|
+
var logger = require('./logger-HQ9yDb8R.cjs');
|
|
6
|
+
var processTreeSnapshot = require('./processTreeSnapshot-D5iNblp6.cjs');
|
|
7
7
|
|
|
8
8
|
const HAPPY_DEFAULT_ENTRYPOINT = "remote_mobile";
|
|
9
9
|
function resolveHappyEntrypoint(currentValue) {
|