very-happy-cli 0.2.193 → 0.2.195
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-B4PwjqHt.mjs → AcpBackend-BTIF87yb.mjs} +3 -3
- package/dist/{AcpBackend-DtJCgftG.cjs → AcpBackend-CXSV6FF5.cjs} +3 -3
- package/dist/{AcpSessionManager-D4qshX_H.cjs → AcpSessionManager-BbWODxSp.cjs} +2 -2
- package/dist/{AcpSessionManager-BzKWgkdP.mjs → AcpSessionManager-CEpU_GVk.mjs} +2 -2
- package/dist/{BasePermissionHandler-DV6UM6e9.mjs → BasePermissionHandler-B5ka7Aaf.mjs} +1 -1
- package/dist/{BasePermissionHandler-5iG-cvA2.cjs → BasePermissionHandler-C6iF28Ct.cjs} +1 -1
- package/dist/{account-DvpA60oU.cjs → account-Bvcdk9CH.cjs} +11 -11
- package/dist/{account-Dco_nGT4.mjs → account-WSJcdMGl.mjs} +11 -11
- package/dist/{accountService-Cd7bnkfd.mjs → accountService-BtEgv0fC.mjs} +4 -4
- package/dist/{accountService-CuUSJDhP.cjs → accountService-DL6xhVUa.cjs} +4 -4
- package/dist/{acpSessionResume-Bk9mjXZ9.cjs → acpSessionResume-B2hd1Wub.cjs} +1 -1
- package/dist/{acpSessionResume-TQwN9ZZE.mjs → acpSessionResume-BYMm4w8Q.mjs} +1 -1
- package/dist/{agentHome-c2dlgcw1.cjs → agentHome-CVM15_3U.cjs} +4 -4
- package/dist/{agentHome-Bep8semY.mjs → agentHome-Jl8yWAjF.mjs} +4 -4
- package/dist/{api-DUfunY3x.mjs → api-DOzNOoVJ.mjs} +10 -10
- package/dist/{api-CBE_a88I.cjs → api-TpjZJXV-.cjs} +10 -10
- package/dist/{apiMachine-BqtG0IWm.cjs → apiMachine-COkvJAmd.cjs} +35 -19
- package/dist/{apiMachine-CU_bw5nV.mjs → apiMachine-M-Fs9g5Y.mjs} +35 -19
- package/dist/{attachmentContent-B3AzuYqk.cjs → attachmentContent-BiBOjTXX.cjs} +2 -2
- package/dist/{attachmentContent-KNIZxwlu.mjs → attachmentContent-D6PjMVDq.mjs} +2 -2
- package/dist/{auth-SJ_dPw7H.cjs → auth-BOceB8cL.cjs} +8 -8
- package/dist/{auth-CZ7pKS-j.mjs → auth-BfHLe1gU.mjs} +8 -8
- package/dist/{auth-jN5dNqTO.mjs → auth-Bfe3Ue_B.mjs} +5 -5
- package/dist/{auth-DCjxpI6Z.cjs → auth-DfcdjMUp.cjs} +5 -5
- package/dist/{auto-DC0Sq-qB.mjs → auto-CDeivd5V.mjs} +18 -18
- package/dist/{auto-B_59RYH1.cjs → auto-CnTitokD.cjs} +18 -18
- package/dist/{bootstrap-B3gMpU9e.mjs → bootstrap-BxcKrgR9.mjs} +2 -2
- package/dist/{bootstrap-CoJu9VnB.cjs → bootstrap-DpyP22Wx.cjs} +2 -2
- package/dist/{browser-LHW2hBH8.mjs → browser-Bb0Gqffc.mjs} +1 -1
- package/dist/{browser-v1pdPP1E.cjs → browser-ac0aPrVE.cjs} +1 -1
- package/dist/{claudeAccountEnv-BL1pR_37.mjs → claudeAccountEnv-NyoxjLuJ.mjs} +1 -1
- package/dist/{claudeAccountEnv-CEX_EMZr.cjs → claudeAccountEnv-_O3x5AJ1.cjs} +1 -1
- package/dist/{claudeLocal-BrzM2RBI.cjs → claudeLocal-RGWhplSr.cjs} +5 -5
- package/dist/{claudeLocal-BZUgA5G2.mjs → claudeLocal-otwxWF6e.mjs} +5 -5
- package/dist/{claudeLocalLauncher-A0AQyHFi.mjs → claudeLocalLauncher-CTibA4cU.mjs} +10 -10
- package/dist/{claudeLocalLauncher-XAMpXUM7.cjs → claudeLocalLauncher-yG-MBhY7.cjs} +10 -10
- package/dist/{claudeSessionFork-Mhn2fYe_.cjs → claudeSessionFork-DH_Su4uO.cjs} +104 -38
- package/dist/{claudeSessionFork-_GwIlmMB.mjs → claudeSessionFork-HFFwivGY.mjs} +105 -40
- package/dist/{client-DwbhrX6D.mjs → client-BhAjEv8Z.mjs} +4 -4
- package/dist/{client-D2GWkd-T.cjs → client-BlV73Gbw.cjs} +2 -2
- package/dist/{client-Bde4QVIn.mjs → client-CydHzidF.mjs} +2 -2
- package/dist/{client-CJr8Pjwm.cjs → client-DcXLNaF2.cjs} +2 -2
- package/dist/{client-7RnI9J0W.mjs → client-DpTk1S7C.mjs} +2 -2
- package/dist/{client-DLlnmAPL.cjs → client-DxjYsJ8d.cjs} +4 -4
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAccount-NOX5pmQf.mjs → codexAccount-CKXpXq0B.mjs} +1 -1
- package/dist/{codexAccount-BDQjRbtI.cjs → codexAccount-CYhQir50.cjs} +1 -1
- package/dist/{codexAppServerClient-DWEsZUC4.cjs → codexAppServerClient-C1xBSuVk.cjs} +60 -3
- package/dist/{codexAppServerClient-B3QJV6Ey.mjs → codexAppServerClient-mln0W8vT.mjs} +60 -3
- package/dist/{codexCommand-D1xlj4sT.mjs → codexCommand-CmWhYduF.mjs} +136 -47
- package/dist/{codexCommand-Bg8AmxVm.cjs → codexCommand-Plm-_aRy.cjs} +137 -48
- package/dist/{codexTermination-ByX9GcEJ.cjs → codexTermination-C9c80lIF.cjs} +1 -1
- package/dist/{codexTermination-CaWAVQjZ.mjs → codexTermination-QltAvFpq.mjs} +1 -1
- package/dist/{codexThreadFork-5kwoKjMu.cjs → codexThreadFork-C6ZmcT2z.cjs} +22 -1
- package/dist/{codexThreadFork-DobPd19R.mjs → codexThreadFork-CVzAqELg.mjs} +22 -2
- package/dist/{config-B2GGbiTv.cjs → config-BH75enfT.cjs} +3 -3
- package/dist/{config-C2XYEwXz.mjs → config-DK27kWTT.mjs} +3 -3
- package/dist/{configuration-BBK0rmmj.cjs → configuration-CKaq0tNe.cjs} +1 -1
- package/dist/{configuration-ThKBP_zY.mjs → configuration-CwfgJZKs.mjs} +1 -1
- package/dist/{connect-C3tZs_NC.cjs → connect-_QkCFMxO.cjs} +13 -13
- package/dist/{connect-BirnCl9q.mjs → connect-h3_VMJst.mjs} +13 -13
- package/dist/{context-wDp0aZBK.cjs → context-DbENnaVc.cjs} +1 -1
- package/dist/{context-C0EFLnOg.mjs → context-DcOpvIiR.mjs} +1 -1
- package/dist/{controlClient-DwWTns3A.cjs → controlClient-D_HIbnnS.cjs} +3 -3
- package/dist/{controlClient-Ckl8N1MS.mjs → controlClient-Dv6IvvUq.mjs} +4 -4
- package/dist/{createSessionMetadata-DqZ6h02H.cjs → createSessionMetadata-CusO22Am.cjs} +2 -2
- package/dist/{createSessionMetadata-vug4Cv8z.mjs → createSessionMetadata-DimBsfVG.mjs} +2 -2
- package/dist/{daemonAccounts-CpGDY_4k.cjs → daemonAccounts-CxMJw7x2.cjs} +2 -2
- package/dist/{daemonAccounts-DwPwKxvv.mjs → daemonAccounts-QT-RDDEp.mjs} +3 -3
- package/dist/{defaultPermissionMode-DF5AfeBb.mjs → defaultPermissionMode-B-Vt8ECY.mjs} +1 -1
- package/dist/{defaultPermissionMode-BakXiqRr.cjs → defaultPermissionMode-BCWCMONI.cjs} +1 -1
- package/dist/{deterministicJson-t33SsuRC.cjs → deterministicJson-BYqRKTmL.cjs} +13 -13
- package/dist/{deterministicJson-BzX94gi3.mjs → deterministicJson-CMApF2Rl.mjs} +13 -13
- package/dist/{doctor-C1zyOSXw.mjs → doctor-BkyoZ0Uw.mjs} +7 -7
- package/dist/{doctor-B9ug1LZb.cjs → doctor-Czbl7gk2.cjs} +7 -7
- package/dist/{downloadTarget-T1id2Gh6.cjs → downloadTarget-C5BzZ_bz.cjs} +6 -6
- package/dist/{downloadTarget-Baslc6jW.mjs → downloadTarget-CM0BZNSY.mjs} +6 -6
- package/dist/{ensureDaemonRunning-CoAg11Zi.cjs → ensureDaemonRunning-D508DmcP.cjs} +5 -5
- package/dist/{ensureDaemonRunning-C6ERYK-O.mjs → ensureDaemonRunning-P399ot_C.mjs} +5 -5
- package/dist/{handleResumeCommand-CrlqDuz7.mjs → handleResumeCommand-BK_2ShBf.mjs} +5 -5
- package/dist/{handleResumeCommand-DPi-sPm7.cjs → handleResumeCommand-CCgK7-0v.cjs} +5 -5
- package/dist/{index-Cn73rdtQ.mjs → index-BENDk1i9.mjs} +4 -4
- package/dist/{index-rocrvOYG.cjs → index-BalJgriQ.cjs} +4 -4
- package/dist/{index-D1YnIih6.mjs → index-BlWyEpMw.mjs} +2 -1
- package/dist/{index-B2dJA8VG.cjs → index-Bz9Bj7l1.cjs} +3 -3
- package/dist/{index-B1swQJUS.cjs → index-CGKn-GTK.cjs} +4 -4
- package/dist/{index-Bkslzin5.cjs → index-CSO1-mZ9.cjs} +42 -42
- package/dist/{index-BUFrKZeQ.cjs → index-D9Hidq-g.cjs} +2 -0
- package/dist/{index-BcSPg3c5.mjs → index-DR3NJLVk.mjs} +4 -4
- package/dist/{index-BbdV2mzy.mjs → index-QSAckvNv.mjs} +3 -3
- package/dist/{index-fZO4nF6e.mjs → index-_DRVKtSd.mjs} +43 -43
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-CArXjPfW.cjs → install-CqXaN7_C.cjs} +3 -3
- package/dist/{install-CChhyV2G.mjs → install-DMTvEPrB.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-B_v6qgfE.cjs → lidState-Btv4N_B8.cjs} +1 -1
- package/dist/{lidState-B6yYKjNK.mjs → lidState-Cb3TbhPb.mjs} +1 -1
- package/dist/{localHappyAgentAuth-jJH0n67S.cjs → localHappyAgentAuth-B3Q5DNLR.cjs} +1 -1
- package/dist/{localHappyAgentAuth-KRlg_aI0.mjs → localHappyAgentAuth-CAAIUJyY.mjs} +1 -1
- package/dist/{logger-CX3x2eI4.cjs → logger-BZ5TcbEh.cjs} +2 -2
- package/dist/{logger-JV7-4Q_6.mjs → logger-UgDpJA2u.mjs} +2 -2
- package/dist/{machineMetadata-D5-SW9kv.mjs → machineMetadata-BYHC-3Vx.mjs} +3 -3
- package/dist/{machineMetadata-DhZuM0iB.cjs → machineMetadata-DLb-m4fL.cjs} +3 -3
- package/dist/{main-CFOdXbPD.mjs → main-CwW6lHIw.mjs} +47 -47
- package/dist/{main-1x1HGQEy.cjs → main-LavPb80B.cjs} +47 -47
- package/dist/{mcp-BnKBSEh7.cjs → mcp-BQbWhqUh.cjs} +18 -18
- package/dist/{mcp-R6lMcFLO.mjs → mcp-BjYz5Ymf.mjs} +18 -18
- package/dist/{mirrorProtocol-CD4ntuZJ.mjs → mirrorProtocol-BH5eT99U.mjs} +3 -3
- package/dist/{mirrorProtocol-DO-KtvAL.cjs → mirrorProtocol-Ci9YmCEV.cjs} +3 -3
- package/dist/{package-uzlvxa5S.cjs → package-B61-BBlh.cjs} +7 -7
- package/dist/{package-Bw3H6VLn.mjs → package-C4OfB2YF.mjs} +7 -7
- package/dist/{panels-C46FxjmH.cjs → panels-ByprLJag.cjs} +5 -5
- package/dist/{panels-BamhZCoZ.mjs → panels-cBJT5Up1.mjs} +5 -5
- package/dist/{peerTools-D-VNNFw-.cjs → peerTools-BXSjS8lB.cjs} +5 -5
- package/dist/{peerTools-WtRgTSqG.mjs → peerTools-DS6GqJcn.mjs} +5 -5
- package/dist/{persistence-Cg4sfjQV.mjs → persistence-CQhmtobL.mjs} +2 -2
- package/dist/{persistence-CsmAgN-C.cjs → persistence-DBmeYlwT.cjs} +2 -2
- package/dist/{piRunnerArgs-vnFygygF.cjs → piRunnerArgs-CmEE058l.cjs} +1 -1
- package/dist/{piRunnerArgs-BbaAQvb4.mjs → piRunnerArgs-Dy-3vN_Q.mjs} +1 -1
- package/dist/{piRuntime-C2uj5Ucx.cjs → piRuntime-BCXjC4__.cjs} +1 -1
- package/dist/{piRuntime-Bid7TBf5.mjs → piRuntime-Rq9v4M4e.mjs} +1 -1
- package/dist/{piTerminal-CqxgrI13.mjs → piTerminal-CRhDUqX7.mjs} +20 -20
- package/dist/{piTerminal-Ckpjfoqa.cjs → piTerminal-ehNQOvLL.cjs} +20 -20
- package/dist/{pushNotifications-BbE-qV9I.mjs → pushNotifications-67GmbVfE.mjs} +3 -3
- package/dist/{pushNotifications-BCg7YAiu.cjs → pushNotifications-qCS7_tDF.cjs} +3 -3
- package/dist/{query-vQ-HG394.cjs → query-B4QIiI7e.cjs} +1 -1
- package/dist/{query-Bfr9O_62.mjs → query-CIDBGnv6.mjs} +1 -1
- package/dist/{rateLimitWindows-CRARnKaI.mjs → rateLimitWindows-8-khalzj.mjs} +1 -1
- package/dist/{rateLimitWindows-BZl6GMwQ.cjs → rateLimitWindows-BIfLMxOk.cjs} +1 -1
- package/dist/{registerCommonHandlers-Cj3Nl9y-.mjs → registerCommonHandlers-C7hlztAO.mjs} +2 -2
- package/dist/{registerCommonHandlers-CZGmrPbT.cjs → registerCommonHandlers-G2p0MJu4.cjs} +2 -2
- package/dist/{registerKillSessionHandler-C3EDnW4F.cjs → registerKillSessionHandler-BWvl6wro.cjs} +6 -6
- package/dist/{registerKillSessionHandler-Bg9t45Ub.mjs → registerKillSessionHandler-rwXdO0t0.mjs} +6 -6
- package/dist/registerSideQuestionHandler-CsyPnjce.cjs +366 -0
- package/dist/registerSideQuestionHandler-Xg46gSVh.mjs +358 -0
- package/dist/{remoteSessionClient-CcSP24Zq.cjs → remoteSessionClient-D6_7vNKc.cjs} +5 -5
- package/dist/{remoteSessionClient--0vfA7I5.mjs → remoteSessionClient-DQSnC7ox.mjs} +5 -5
- package/dist/{reportProgressTool-Ddg1yVq2.cjs → reportProgressTool-CIHGKraF.cjs} +3 -3
- package/dist/{reportProgressTool-DVru7jc_.mjs → reportProgressTool-HjzV5y_2.mjs} +3 -3
- package/dist/{run-HtvH6BLi.mjs → run-M06F1958.mjs} +40 -40
- package/dist/{run-BTrIT_jU.cjs → run-tQ4bFkHu.cjs} +40 -40
- package/dist/{runClaude-ipjwAHPI.cjs → runClaude-Ct0_mShC.cjs} +28 -26
- package/dist/{runClaude-DsHTk5Bu.mjs → runClaude-Dm9kQZ-w.mjs} +28 -26
- package/dist/{runClaudeDeps-BKpwL6ln.cjs → runClaudeDeps-BT2kWCrQ.cjs} +44 -333
- package/dist/{runClaudeDeps-BV3vpeyY.mjs → runClaudeDeps-DNOzXjc3.mjs} +47 -336
- package/dist/{runGemini-DhjK6_Fp.mjs → runGemini-BvN-yeQR.mjs} +33 -33
- package/dist/{runGemini-B-G0_7Ab.cjs → runGemini-cua7_iuR.cjs} +33 -33
- package/dist/{runOpenClaw-B6lawk8n.mjs → runOpenClaw-C9E2XzmX.mjs} +18 -18
- package/dist/{runOpenClaw-BHIo8tkn.cjs → runOpenClaw-NpYFRhKm.cjs} +18 -18
- package/dist/{sandbox-CKb7pCXg.mjs → sandbox-C-BXZbt9.mjs} +4 -4
- package/dist/{sandbox-BAsO0ILe.cjs → sandbox-hImfD0-T.cjs} +4 -4
- package/dist/{selfCheck-D4VvVZNi.cjs → selfCheck-B3ulijQM.cjs} +39 -39
- package/dist/selfCheck-D-e9kVhc.mjs +88 -0
- package/dist/{send-Cz5m39QR.cjs → send-BCVQkTOl.cjs} +8 -8
- package/dist/{send-D8ipLKMY.mjs → send-Dv2L8IRW.mjs} +8 -8
- package/dist/{server-CjvgT3N9.mjs → server-BBBfuSB-.mjs} +4 -4
- package/dist/{server-CySyJKPH.cjs → server-DYxyCyYF.cjs} +6 -6
- package/dist/{sessionLock-DdDCuNUs.cjs → sessionLock-B8fsnpZD.cjs} +3 -3
- package/dist/{sessionLock-B73fhgQN.mjs → sessionLock-BexUoWhZ.mjs} +3 -3
- package/dist/{sessionOps-XSEjIqNq.cjs → sessionOps-74pSDXoS.cjs} +4 -4
- package/dist/{sessionOps-C65Iej_C.mjs → sessionOps-BkEgNA2O.mjs} +5 -5
- package/dist/{sessionProvider-Dgsty8z_.cjs → sessionProvider-CWgHsZUA.cjs} +10 -10
- package/dist/{sessionProvider-CLVNkfji.mjs → sessionProvider-DXkhlJE6.mjs} +10 -10
- package/dist/{sessionScanner-D8IVXMMH.cjs → sessionScanner-D56EkcIj.cjs} +3 -3
- package/dist/{sessionScanner-MW1P9Pm9.mjs → sessionScanner-Dhh1wREW.mjs} +3 -3
- package/dist/{sessions-BKz7gZqg.cjs → sessions-C1zRTjUe.cjs} +10 -10
- package/dist/{sessions-Dtk_agUL.mjs → sessions-dJR6k3JY.mjs} +10 -10
- package/dist/{setupOfflineReconnection-DxMiW7OV.cjs → setupOfflineReconnection-CMUdHtFT.cjs} +2 -2
- package/dist/{setupOfflineReconnection-Bvdy-2xd.mjs → setupOfflineReconnection-Dp1rC-eP.mjs} +2 -2
- package/dist/{spawn-Dm4xsZBX.mjs → spawn-D3-Weoiq.mjs} +54 -20
- package/dist/{spawn-DiPkJcrQ.cjs → spawn-kMKI09Kh.cjs} +54 -20
- package/dist/{spawnAgents-B9olJ8xn.cjs → spawnAgents-Cm23BW-D.cjs} +1 -1
- package/dist/{spawnAgents-I29H9nO8.mjs → spawnAgents-hKFGQaSJ.mjs} +1 -1
- package/dist/{spawnHappyCLI-CnMwzjWX.mjs → spawnHappyCLI-CgjpjSTT.mjs} +1 -1
- package/dist/{spawnHappyCLI-BYGOUda1.cjs → spawnHappyCLI-Du1IgJGA.cjs} +1 -1
- package/dist/{startFileWatcher-D14W6gn-.cjs → startFileWatcher-DGOnF95-.cjs} +1 -1
- package/dist/{startFileWatcher-DePAY1T5.mjs → startFileWatcher-DapvIGxp.mjs} +1 -1
- package/dist/{startupSessionCreate-DoK0IvJG.mjs → startupSessionCreate-CSi60oo_.mjs} +3 -3
- package/dist/{startupSessionCreate-rBHd4tc1.cjs → startupSessionCreate-rkIMVGJW.cjs} +3 -3
- package/dist/{store-Vej_738f.mjs → store-Tf-r1ouq.mjs} +1 -1
- package/dist/{store-CkNa6oj4.cjs → store-aa3CVNwS.cjs} +1 -1
- package/dist/{streamRelay-C0G1HOOd.cjs → streamRelay-C2Lb2z39.cjs} +1 -1
- package/dist/{streamRelay-C5U-C4GS.mjs → streamRelay-C9lzMo0V.mjs} +1 -1
- package/dist/{sync-WYBwkJvG.cjs → sync-Cj8Vhltg.cjs} +1 -1
- package/dist/{sync-BP6vnxVP.mjs → sync-GJkf-HGu.mjs} +1 -1
- package/dist/{systemPrompt-aRqBmkpw.mjs → systemPrompt-BEagRbDZ.mjs} +2 -2
- package/dist/{systemPrompt-BkQlCk5_.cjs → systemPrompt-Cne9i1SE.cjs} +2 -2
- package/dist/{teams-CGmC4ygu.mjs → teams-C_18IMNM.mjs} +7 -7
- package/dist/{teams-phbpwAGD.cjs → teams-ClTg6hQ1.cjs} +7 -7
- package/dist/{template-B9pLEP8v.cjs → template-B1AORlgU.cjs} +1 -1
- package/dist/{template-CL9EvQLQ.mjs → template-Ci-cyigF.mjs} +1 -1
- package/dist/{time-BTLcO8jp.cjs → time-BPPTQ_sE.cjs} +1 -1
- package/dist/{time-Cw0liIqB.mjs → time-CIkdLyza.mjs} +1 -1
- package/dist/{titleGenerator-Y1_7ceJC.cjs → titleGenerator-B_OgL9Pd.cjs} +3 -3
- package/dist/{titleGenerator-h6TmFe-c.mjs → titleGenerator-DnwTdTB_.mjs} +2 -2
- package/dist/{todo-BxiPiCvB.cjs → todo-DPQHtZVM.cjs} +6 -6
- package/dist/{todo-OKcTC_VC.mjs → todo-DmHolFRy.mjs} +6 -6
- package/dist/{tools-CcebYtLj.cjs → tools-B3KGMSU5.cjs} +1 -1
- package/dist/{tools-BR-drXZ8.mjs → tools-DqjPHq9I.mjs} +1 -1
- package/dist/{uninstall-D3stWKD2.mjs → uninstall-Cm97eybp.mjs} +3 -3
- package/dist/{uninstall-CnDeCC-M.cjs → uninstall-CrK5dgx8.cjs} +3 -3
- package/dist/{wrapperAccount-D2A4DuZy.cjs → wrapperAccount-BubTurHU.cjs} +2 -2
- package/dist/{wrapperAccount-BkufO_9g.mjs → wrapperAccount-Cq7eZRMx.mjs} +2 -2
- package/package.json +7 -7
- package/dist/rateLimitReporter-BZ8x0-6-.cjs +0 -44
- package/dist/rateLimitReporter-CAz7VMw4.mjs +0 -42
- package/dist/selfCheck-CZ-t1Xzq.mjs +0 -88
|
@@ -1,78 +1,78 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var controlClient = require('./controlClient-
|
|
3
|
+
var logger = require('./logger-BZ5TcbEh.cjs');
|
|
4
|
+
var controlClient = require('./controlClient-D_HIbnnS.cjs');
|
|
5
5
|
var backgroundTaskActivity = require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
6
|
-
var deterministicJson = require('./deterministicJson-
|
|
7
|
-
var client = require('./client-
|
|
6
|
+
var deterministicJson = require('./deterministicJson-BYqRKTmL.cjs');
|
|
7
|
+
var client = require('./client-DcXLNaF2.cjs');
|
|
8
8
|
var node_crypto = require('node:crypto');
|
|
9
9
|
var specialCommands = require('./specialCommands-J3JFOq0J.cjs');
|
|
10
10
|
var sessionExitLifecycle = require('./sessionExitLifecycle-DFltxXU8.cjs');
|
|
11
|
-
var query = require('./query-
|
|
11
|
+
var query = require('./query-B4QIiI7e.cjs');
|
|
12
12
|
var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
|
|
13
13
|
var permissionMode = require('./permissionMode-CrV-XuMs.cjs');
|
|
14
|
-
var systemPrompt = require('./systemPrompt-
|
|
14
|
+
var systemPrompt = require('./systemPrompt-Cne9i1SE.cjs');
|
|
15
15
|
var path$1 = require('node:path');
|
|
16
16
|
require('axios');
|
|
17
17
|
require('node:events');
|
|
18
18
|
require('socket.io-client');
|
|
19
|
-
var pushNotifications = require('./pushNotifications-
|
|
19
|
+
var pushNotifications = require('./pushNotifications-qCS7_tDF.cjs');
|
|
20
20
|
require('tweetnacl');
|
|
21
|
-
var configuration = require('./configuration-
|
|
22
|
-
require('./index-
|
|
23
|
-
require('./registerCommonHandlers-
|
|
21
|
+
var configuration = require('./configuration-CKaq0tNe.cjs');
|
|
22
|
+
require('./index-D9Hidq-g.cjs');
|
|
23
|
+
require('./registerCommonHandlers-G2p0MJu4.cjs');
|
|
24
24
|
require('os');
|
|
25
25
|
require('child_process');
|
|
26
26
|
require('@paralleldrive/cuid2');
|
|
27
|
-
require('./persistence-
|
|
27
|
+
require('./persistence-DBmeYlwT.cjs');
|
|
28
28
|
var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
29
29
|
require('chalk');
|
|
30
30
|
var types = require('./types-CRS-srZK.cjs');
|
|
31
31
|
var path = require('./path-B7zW-WwE.cjs');
|
|
32
32
|
var fs = require('fs/promises');
|
|
33
|
-
var time = require('./time-
|
|
33
|
+
var time = require('./time-BPPTQ_sE.cjs');
|
|
34
34
|
var node_fs = require('node:fs');
|
|
35
|
-
var sessionScanner = require('./sessionScanner-
|
|
35
|
+
var sessionScanner = require('./sessionScanner-D56EkcIj.cjs');
|
|
36
36
|
var node_child_process = require('node:child_process');
|
|
37
|
-
var streamRelay = require('./streamRelay-
|
|
38
|
-
var attachmentContent = require('./attachmentContent-
|
|
37
|
+
var streamRelay = require('./streamRelay-C2Lb2z39.cjs');
|
|
38
|
+
var attachmentContent = require('./attachmentContent-BiBOjTXX.cjs');
|
|
39
39
|
var promises = require('node:fs/promises');
|
|
40
|
-
var claudeSessionFork = require('./claudeSessionFork-
|
|
41
|
-
var
|
|
42
|
-
var wrapperAccount = require('./wrapperAccount-
|
|
43
|
-
var registerKillSessionHandler = require('./registerKillSessionHandler-
|
|
44
|
-
var doctor = require('./doctor-
|
|
40
|
+
var claudeSessionFork = require('./claudeSessionFork-DH_Su4uO.cjs');
|
|
41
|
+
var registerSideQuestionHandler = require('./registerSideQuestionHandler-CsyPnjce.cjs');
|
|
42
|
+
var wrapperAccount = require('./wrapperAccount-BubTurHU.cjs');
|
|
43
|
+
var registerKillSessionHandler = require('./registerKillSessionHandler-BWvl6wro.cjs');
|
|
44
|
+
var doctor = require('./doctor-Czbl7gk2.cjs');
|
|
45
45
|
var node_http = require('node:http');
|
|
46
46
|
var editPaths = require('./editPaths-Bqp4OFPw.cjs');
|
|
47
47
|
var projectPath = require('./projectPath-C3ioB4Bu.cjs');
|
|
48
48
|
var processTreeSnapshot = require('./processTreeSnapshot-mDbnuojn.cjs');
|
|
49
|
-
var titleGenerator = require('./titleGenerator-
|
|
49
|
+
var titleGenerator = require('./titleGenerator-B_OgL9Pd.cjs');
|
|
50
50
|
var oneShotPrompts = require('./oneShotPrompts-CL0dip9C.cjs');
|
|
51
|
-
var reportProgressTool = require('./reportProgressTool-
|
|
51
|
+
var reportProgressTool = require('./reportProgressTool-CIHGKraF.cjs');
|
|
52
52
|
require('node:util');
|
|
53
53
|
require('./prompt-Bof2aQkI.cjs');
|
|
54
54
|
require('node:os');
|
|
55
55
|
require('zod');
|
|
56
56
|
require('./pi-DlsrPCTa.cjs');
|
|
57
57
|
require('./fileStore-7qhnbs6N.cjs');
|
|
58
|
-
require('./client-
|
|
59
|
-
require('./context-
|
|
60
|
-
require('./sessionOps-
|
|
58
|
+
require('./client-DxjYsJ8d.cjs');
|
|
59
|
+
require('./context-DbENnaVc.cjs');
|
|
60
|
+
require('./sessionOps-74pSDXoS.cjs');
|
|
61
61
|
require('./authRelay-Dy1qU9td.cjs');
|
|
62
62
|
require('./resources-BZ_Be0qM.cjs');
|
|
63
|
-
require('./tools-
|
|
64
|
-
require('./peerTools-
|
|
63
|
+
require('./tools-B3KGMSU5.cjs');
|
|
64
|
+
require('./peerTools-BXSjS8lB.cjs');
|
|
65
65
|
require('./ids-B6ZC0HGt.cjs');
|
|
66
|
-
require('./remoteSessionClient-
|
|
66
|
+
require('./remoteSessionClient-D6_7vNKc.cjs');
|
|
67
67
|
require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
68
68
|
require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
69
69
|
require('./limits-C-a7gr04.cjs');
|
|
70
|
-
require('./downloadTarget-
|
|
70
|
+
require('./downloadTarget-C5BzZ_bz.cjs');
|
|
71
71
|
require('./terminals-B_bfC9c2.cjs');
|
|
72
72
|
require('./terminalTitleSuggest-DhvRFX3H.cjs');
|
|
73
73
|
require('./tmuxSocket-D-Xt6Vn-.cjs');
|
|
74
|
-
require('./bootstrap-
|
|
75
|
-
require('./package-
|
|
74
|
+
require('./bootstrap-DpyP22Wx.cjs');
|
|
75
|
+
require('./package-B61-BBlh.cjs');
|
|
76
76
|
require('./agentGuidance-BtBx2xxE.cjs');
|
|
77
77
|
require('./trimIdent-4gvk9Wk6.cjs');
|
|
78
78
|
require('./webPanels-FCgFKvVe.cjs');
|
|
@@ -82,24 +82,24 @@ require('./promptCacheTtl-B8PCzE6k.cjs');
|
|
|
82
82
|
require('util');
|
|
83
83
|
require('path');
|
|
84
84
|
require('cross-spawn');
|
|
85
|
-
require('./sync-
|
|
85
|
+
require('./sync-Cj8Vhltg.cjs');
|
|
86
86
|
require('./transcriptCursor-DcXGLeSc.cjs');
|
|
87
|
-
require('./startFileWatcher-
|
|
87
|
+
require('./startFileWatcher-DGOnF95-.cjs');
|
|
88
88
|
require('node:readline');
|
|
89
|
-
require('./rateLimitWindows-
|
|
90
|
-
require('./claudeAccountEnv-
|
|
91
|
-
require('./store-
|
|
89
|
+
require('./rateLimitWindows-BIfLMxOk.cjs');
|
|
90
|
+
require('./claudeAccountEnv-_O3x5AJ1.cjs');
|
|
91
|
+
require('./store-aa3CVNwS.cjs');
|
|
92
92
|
require('./doctor-u46qYYKX.cjs');
|
|
93
93
|
require('ps-list');
|
|
94
94
|
require('./doctorReadiness-Dl6yRQCy.cjs');
|
|
95
95
|
require('./detectCLI-BuYR_Qxe.cjs');
|
|
96
96
|
require('fs');
|
|
97
97
|
require('./cliUpdate-DsKXPFYp.cjs');
|
|
98
|
-
require('./piRunnerArgs-
|
|
99
|
-
require('./acpSessionResume-
|
|
98
|
+
require('./piRunnerArgs-CmEE058l.cjs');
|
|
99
|
+
require('./acpSessionResume-B2hd1Wub.cjs');
|
|
100
100
|
require('url');
|
|
101
101
|
require('node:module');
|
|
102
|
-
require('./client-
|
|
102
|
+
require('./client-BlV73Gbw.cjs');
|
|
103
103
|
require('./precheckCompat-CWOi5c9L.cjs');
|
|
104
104
|
|
|
105
105
|
const SCHEDULE_WAKEUP_GRACE_MS = 6e4;
|
|
@@ -4031,7 +4031,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
4031
4031
|
let notifiedQuestionToolCalls = /* @__PURE__ */ new Set();
|
|
4032
4032
|
function onMessage(message) {
|
|
4033
4033
|
if (message.type === "rate_limit_event") {
|
|
4034
|
-
|
|
4034
|
+
registerSideQuestionHandler.wrapperRateLimitReporter().observeClaude(message.rate_limit_info);
|
|
4035
4035
|
}
|
|
4036
4036
|
runtimeControls.observe(message);
|
|
4037
4037
|
backgroundTasks.observe(message);
|
|
@@ -4553,7 +4553,7 @@ async function loop(opts) {
|
|
|
4553
4553
|
logger.logger.debug(`[loop] Iteration with mode: ${mode}`);
|
|
4554
4554
|
switch (mode) {
|
|
4555
4555
|
case "local": {
|
|
4556
|
-
const { claudeLocalLauncher } = await Promise.resolve().then(function () { return require('./claudeLocalLauncher-
|
|
4556
|
+
const { claudeLocalLauncher } = await Promise.resolve().then(function () { return require('./claudeLocalLauncher-yG-MBhY7.cjs'); });
|
|
4557
4557
|
const result = await claudeLocalLauncher(session);
|
|
4558
4558
|
switch (result.type) {
|
|
4559
4559
|
case "switch":
|
|
@@ -4719,296 +4719,6 @@ function cleanupHookSettingsFile(filepath) {
|
|
|
4719
4719
|
}
|
|
4720
4720
|
}
|
|
4721
4721
|
|
|
4722
|
-
function isUnsupportedSideQuestionError(error) {
|
|
4723
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
4724
|
-
return /unknown|unsupported|not supported|unrecognized|invalid.*subtype/i.test(message);
|
|
4725
|
-
}
|
|
4726
|
-
async function runSideQuestionLive(ask, input) {
|
|
4727
|
-
const history = (input.history ?? []).filter((h) => h.question.trim() && h.answer.trim()).slice(-12).map((h) => ({ question: clip(h.question.trim(), MAX_HISTORY_CHARS), response: clip(h.answer.trim(), MAX_HISTORY_CHARS) }));
|
|
4728
|
-
const result = await ask({ question: input.question.trim(), ...history.length ? { history } : {} }, input.signal);
|
|
4729
|
-
if (input.signal?.aborted) throw new Error("Side question cancelled");
|
|
4730
|
-
const text = typeof result?.response === "string" ? result.response : "";
|
|
4731
|
-
if (!text.trim()) throw new Error("Side question ended without a result");
|
|
4732
|
-
const fallback = result.refusal_fallback?.content;
|
|
4733
|
-
const answer = fallback ? `\u26A0 ${fallback}
|
|
4734
|
-
|
|
4735
|
-
${text}` : text;
|
|
4736
|
-
input.onText?.(answer);
|
|
4737
|
-
return { answer, hadContext: true, mode: "live" };
|
|
4738
|
-
}
|
|
4739
|
-
const SIDE_QUESTION_SYSTEM_PROMPT = [
|
|
4740
|
-
"A user message wrapped in a side-question system-reminder is a SIDE QUESTION: answer it",
|
|
4741
|
-
"directly in one response from the conversation context, with no tools and no action on the main task."
|
|
4742
|
-
].join(" ");
|
|
4743
|
-
const SIDE_QUESTION_REMINDER = [
|
|
4744
|
-
"<system-reminder>This is a side question from the user. You must answer this question directly in a single response.",
|
|
4745
|
-
"",
|
|
4746
|
-
"IMPORTANT CONTEXT:",
|
|
4747
|
-
"- You are a separate, lightweight agent spawned to answer this one question",
|
|
4748
|
-
"- The main agent is NOT interrupted - it continues working independently in the background",
|
|
4749
|
-
"- You share the conversation context but are a completely separate instance",
|
|
4750
|
-
'- Do NOT reference being interrupted or what you were "previously doing" - that framing is incorrect',
|
|
4751
|
-
"",
|
|
4752
|
-
"CRITICAL CONSTRAINTS:",
|
|
4753
|
-
"- You have NO tools available - you cannot read files, run commands, search, or take any actions",
|
|
4754
|
-
"- This is a one-off response - there will be no follow-up turns",
|
|
4755
|
-
"- You can ONLY provide information based on what you already know from the conversation context",
|
|
4756
|
-
`- NEVER say things like "Let me try...", "I'll now...", "Let me check...", or promise to take any action`,
|
|
4757
|
-
"- If you don't know the answer, say so - do not offer to look it up or investigate",
|
|
4758
|
-
"",
|
|
4759
|
-
"Simply answer the question with the information you have.</system-reminder>"
|
|
4760
|
-
].join("\n");
|
|
4761
|
-
const MAX_HISTORY_CHARS = 2e3;
|
|
4762
|
-
function clip(text, max) {
|
|
4763
|
-
return text.length > max ? `${text.slice(0, max)}\u2026` : text;
|
|
4764
|
-
}
|
|
4765
|
-
function buildSideQuestionPrompt(question, history = []) {
|
|
4766
|
-
const trimmed = question.trim();
|
|
4767
|
-
const prior = history.filter((h) => h.question.trim() && h.answer.trim()).slice(-12);
|
|
4768
|
-
const body = `${SIDE_QUESTION_REMINDER}
|
|
4769
|
-
|
|
4770
|
-
${trimmed}`;
|
|
4771
|
-
if (prior.length === 0) return body;
|
|
4772
|
-
const lines = prior.map((h) => `Q: ${clip(h.question.trim(), MAX_HISTORY_CHARS)}
|
|
4773
|
-
A: ${clip(h.answer.trim(), MAX_HISTORY_CHARS)}`);
|
|
4774
|
-
return `<earlier-side-questions>
|
|
4775
|
-
${lines.join("\n\n")}
|
|
4776
|
-
</earlier-side-questions>
|
|
4777
|
-
|
|
4778
|
-
${body}`;
|
|
4779
|
-
}
|
|
4780
|
-
function sideQuestionQueryOptions(input) {
|
|
4781
|
-
return {
|
|
4782
|
-
cwd: input.cwd,
|
|
4783
|
-
...input.resumeSessionId ? { resume: input.resumeSessionId, forkSession: true } : {},
|
|
4784
|
-
persistSession: false,
|
|
4785
|
-
tools: [],
|
|
4786
|
-
mcpServers: {},
|
|
4787
|
-
strictMcpConfig: true,
|
|
4788
|
-
maxTurns: 1,
|
|
4789
|
-
includePartialMessages: true,
|
|
4790
|
-
permissionMode: "default",
|
|
4791
|
-
model: input.model,
|
|
4792
|
-
env: input.env,
|
|
4793
|
-
settingsPath: input.settingsPath,
|
|
4794
|
-
appendSystemPrompt: SIDE_QUESTION_SYSTEM_PROMPT,
|
|
4795
|
-
canCallTool: async () => ({ behavior: "deny", message: "Side questions cannot use tools" }),
|
|
4796
|
-
abort: input.signal
|
|
4797
|
-
};
|
|
4798
|
-
}
|
|
4799
|
-
function assistantBlocks(message) {
|
|
4800
|
-
if (message.type !== "assistant") return [];
|
|
4801
|
-
const content = message.message?.content;
|
|
4802
|
-
return Array.isArray(content) ? content.filter((b) => Boolean(b) && typeof b === "object") : [];
|
|
4803
|
-
}
|
|
4804
|
-
function textFromAssistant(message) {
|
|
4805
|
-
return assistantBlocks(message).map((block) => block.type === "text" ? String(block.text ?? "") : "").join("");
|
|
4806
|
-
}
|
|
4807
|
-
function toolUseFromAssistant(message) {
|
|
4808
|
-
const block = assistantBlocks(message).find((b) => b.type === "tool_use");
|
|
4809
|
-
return block ? String(block.name ?? "a tool") : null;
|
|
4810
|
-
}
|
|
4811
|
-
function toolAttemptNotice(toolName) {
|
|
4812
|
-
return `(The model tried to call ${toolName} instead of answering directly. Try rephrasing or ask in the main conversation.)`;
|
|
4813
|
-
}
|
|
4814
|
-
function apiErrorFromSystem(message) {
|
|
4815
|
-
if (message.type !== "system") return null;
|
|
4816
|
-
const m = message;
|
|
4817
|
-
if (m.subtype !== "api_error") return null;
|
|
4818
|
-
if (typeof m.error === "string") return m.error;
|
|
4819
|
-
const detail = m.error?.formatted ?? m.error?.message;
|
|
4820
|
-
return typeof detail === "string" && detail ? detail : "API error";
|
|
4821
|
-
}
|
|
4822
|
-
async function runSideQuestion(query, input) {
|
|
4823
|
-
const options = sideQuestionQueryOptions(input);
|
|
4824
|
-
const stream = query({ prompt: buildSideQuestionPrompt(input.question, input.history), options });
|
|
4825
|
-
let streamed = "";
|
|
4826
|
-
let final = "";
|
|
4827
|
-
let toolAttempt = null;
|
|
4828
|
-
let lastApiError = null;
|
|
4829
|
-
let resultSeen = false;
|
|
4830
|
-
for await (const message of stream) {
|
|
4831
|
-
if (message.type === "stream_event") {
|
|
4832
|
-
const event = message.event;
|
|
4833
|
-
if (event?.type === "content_block_delta" && event.delta?.type === "text_delta" && event.delta.text) {
|
|
4834
|
-
streamed += event.delta.text;
|
|
4835
|
-
input.onText?.(streamed);
|
|
4836
|
-
}
|
|
4837
|
-
continue;
|
|
4838
|
-
}
|
|
4839
|
-
if (message.type === "assistant") {
|
|
4840
|
-
const text = textFromAssistant(message);
|
|
4841
|
-
if (text) {
|
|
4842
|
-
final = final ? `${final}
|
|
4843
|
-
|
|
4844
|
-
${text}` : text;
|
|
4845
|
-
input.onText?.(final);
|
|
4846
|
-
}
|
|
4847
|
-
toolAttempt ??= toolUseFromAssistant(message);
|
|
4848
|
-
continue;
|
|
4849
|
-
}
|
|
4850
|
-
if (message.type === "system") {
|
|
4851
|
-
lastApiError = apiErrorFromSystem(message) ?? lastApiError;
|
|
4852
|
-
continue;
|
|
4853
|
-
}
|
|
4854
|
-
if (message.type === "result") {
|
|
4855
|
-
resultSeen = true;
|
|
4856
|
-
const result = message;
|
|
4857
|
-
if (result.subtype !== "success") {
|
|
4858
|
-
if (toolAttempt && result.subtype === "error_max_turns") break;
|
|
4859
|
-
const detail = Array.isArray(result.errors) && result.errors.length > 0 ? String(result.errors[0]) : typeof result.result === "string" && result.result ? result.result : lastApiError ?? result.subtype ?? "unknown";
|
|
4860
|
-
throw new Error(`Side question failed: ${detail}`);
|
|
4861
|
-
}
|
|
4862
|
-
if (!final && typeof result.result === "string") final = result.result;
|
|
4863
|
-
}
|
|
4864
|
-
}
|
|
4865
|
-
if (input.signal?.aborted) throw new Error("Side question cancelled");
|
|
4866
|
-
if (toolAttempt && !final.trim() && !streamed.trim()) {
|
|
4867
|
-
const notice = toolAttemptNotice(toolAttempt);
|
|
4868
|
-
input.onText?.(notice);
|
|
4869
|
-
return { answer: notice, hadContext: Boolean(input.resumeSessionId), mode: "fork" };
|
|
4870
|
-
}
|
|
4871
|
-
if (!resultSeen && !final && !streamed) throw new Error(`Side question ended without a result${lastApiError ? `: ${lastApiError}` : ""}`);
|
|
4872
|
-
return { answer: final || streamed, hadContext: Boolean(input.resumeSessionId), mode: "fork" };
|
|
4873
|
-
}
|
|
4874
|
-
|
|
4875
|
-
const SIDE_QUESTION_RETAIN_MS = 5 * 6e4;
|
|
4876
|
-
const SIDE_QUESTION_MAX_CHARS = 8e3;
|
|
4877
|
-
const SIDE_QUESTION_MAX_RUN_MS = 10 * 6e4;
|
|
4878
|
-
function writeSideQuestionSettingsFile(homeDir, extra = {}) {
|
|
4879
|
-
const dir = path$1.join(homeDir, "tmp", "hooks");
|
|
4880
|
-
node_fs.mkdirSync(dir, { recursive: true });
|
|
4881
|
-
const file = path$1.join(dir, `side-question-${process.pid}.json`);
|
|
4882
|
-
node_fs.writeFileSync(file, JSON.stringify({ ...extra, disableAllHooks: true }));
|
|
4883
|
-
return file;
|
|
4884
|
-
}
|
|
4885
|
-
function parseHistory(raw) {
|
|
4886
|
-
if (!Array.isArray(raw)) return [];
|
|
4887
|
-
return raw.flatMap((item) => {
|
|
4888
|
-
if (!item || typeof item !== "object") return [];
|
|
4889
|
-
const { question, answer } = item;
|
|
4890
|
-
return typeof question === "string" && typeof answer === "string" ? [{ question, answer }] : [];
|
|
4891
|
-
});
|
|
4892
|
-
}
|
|
4893
|
-
function registerSideQuestionHandler(rpc, deps) {
|
|
4894
|
-
const now = deps.now ?? (() => Date.now());
|
|
4895
|
-
const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
|
|
4896
|
-
const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
|
|
4897
|
-
const fork = deps.run ?? (async (input) => {
|
|
4898
|
-
const { query } = await Promise.resolve().then(function () { return require('./index-rocrvOYG.cjs'); });
|
|
4899
|
-
return runSideQuestion(query, input);
|
|
4900
|
-
});
|
|
4901
|
-
const run = async (input, live) => {
|
|
4902
|
-
if (!live) return fork(input);
|
|
4903
|
-
try {
|
|
4904
|
-
return await runSideQuestionLive(live.ask, input);
|
|
4905
|
-
} catch (error) {
|
|
4906
|
-
if (input.signal?.aborted || !isUnsupportedSideQuestionError(error)) throw error;
|
|
4907
|
-
logger.logger.debug(`[btw] live side question unsupported by this CLI, forking instead: ${error instanceof Error ? error.message : String(error)}`);
|
|
4908
|
-
return fork(input);
|
|
4909
|
-
}
|
|
4910
|
-
};
|
|
4911
|
-
const slots = /* @__PURE__ */ new Map();
|
|
4912
|
-
let active = null;
|
|
4913
|
-
const prune = () => {
|
|
4914
|
-
const t = now();
|
|
4915
|
-
for (const [id, slot] of slots) {
|
|
4916
|
-
if (slot.status !== "running" && slot.finishedAt !== void 0 && t - slot.finishedAt > retainMs) slots.delete(id);
|
|
4917
|
-
}
|
|
4918
|
-
};
|
|
4919
|
-
const finish = (slot, status, error) => {
|
|
4920
|
-
if (slot.status !== "running") return;
|
|
4921
|
-
slot.status = status;
|
|
4922
|
-
slot.error = error;
|
|
4923
|
-
slot.finishedAt = now();
|
|
4924
|
-
if (active === slot) active = null;
|
|
4925
|
-
};
|
|
4926
|
-
rpc.registerHandler("btw-ask", async (request) => {
|
|
4927
|
-
const question = typeof request?.question === "string" ? request.question.trim() : "";
|
|
4928
|
-
if (!question) throw new Error("Side question is empty");
|
|
4929
|
-
if (question.length > SIDE_QUESTION_MAX_CHARS) throw new Error("Side question is too long");
|
|
4930
|
-
prune();
|
|
4931
|
-
if (active) {
|
|
4932
|
-
const stale = active;
|
|
4933
|
-
stale.abort.abort("superseded");
|
|
4934
|
-
finish(stale, "cancelled");
|
|
4935
|
-
logger.logger.debug(`[btw] side question ${stale.requestId} superseded by a new ask`);
|
|
4936
|
-
}
|
|
4937
|
-
const candidate = deps.getLiveQuery?.() ?? null;
|
|
4938
|
-
const live = candidate && candidate.canControl() ? candidate : null;
|
|
4939
|
-
const resumeSessionId = deps.getClaudeSessionId() ?? null;
|
|
4940
|
-
const slot = {
|
|
4941
|
-
requestId: node_crypto.randomUUID(),
|
|
4942
|
-
status: "running",
|
|
4943
|
-
text: "",
|
|
4944
|
-
startedAt: now(),
|
|
4945
|
-
abort: new AbortController()
|
|
4946
|
-
};
|
|
4947
|
-
slots.set(slot.requestId, slot);
|
|
4948
|
-
active = slot;
|
|
4949
|
-
logger.logger.debug(`[btw] side question ${slot.requestId} start (${live ? "live" : resumeSessionId ? "fork" : "no-context"})`);
|
|
4950
|
-
const deadline = setTimeout(() => {
|
|
4951
|
-
if (slot.status !== "running") return;
|
|
4952
|
-
slot.abort.abort("timeout");
|
|
4953
|
-
finish(slot, "error", "Side question timed out");
|
|
4954
|
-
logger.logger.debug(`[btw] side question ${slot.requestId} timed out after ${maxRunMs}ms`);
|
|
4955
|
-
}, maxRunMs);
|
|
4956
|
-
deadline.unref?.();
|
|
4957
|
-
void run({
|
|
4958
|
-
question,
|
|
4959
|
-
history: parseHistory(request.history),
|
|
4960
|
-
resumeSessionId,
|
|
4961
|
-
cwd: deps.cwd,
|
|
4962
|
-
model: deps.getModel(),
|
|
4963
|
-
env: deps.getEnv?.(),
|
|
4964
|
-
settingsPath: deps.settingsPath,
|
|
4965
|
-
signal: slot.abort.signal,
|
|
4966
|
-
onText: (text) => {
|
|
4967
|
-
if (slot.status === "running") slot.text = text;
|
|
4968
|
-
}
|
|
4969
|
-
}, live).then((result) => {
|
|
4970
|
-
slot.text = result.answer;
|
|
4971
|
-
finish(slot, "done");
|
|
4972
|
-
logger.logger.debug(`[btw] side question ${slot.requestId} done (${result.mode ?? "fork"}, ${result.answer.length} chars)`);
|
|
4973
|
-
}).catch((error) => {
|
|
4974
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
4975
|
-
if (slot.abort.signal.aborted) {
|
|
4976
|
-
finish(slot, "cancelled");
|
|
4977
|
-
} else {
|
|
4978
|
-
finish(slot, "error", message);
|
|
4979
|
-
logger.logger.debug(`[btw] side question ${slot.requestId} failed: ${message}`);
|
|
4980
|
-
}
|
|
4981
|
-
}).finally(() => clearTimeout(deadline));
|
|
4982
|
-
return { requestId: slot.requestId, hadContext: live ? true : Boolean(resumeSessionId), mode: live ? "live" : "fork" };
|
|
4983
|
-
});
|
|
4984
|
-
rpc.registerHandler("btw-poll", async (request) => {
|
|
4985
|
-
prune();
|
|
4986
|
-
const id = typeof request?.requestId === "string" ? request.requestId : "";
|
|
4987
|
-
const slot = slots.get(id);
|
|
4988
|
-
if (!slot) throw new Error("Unknown side question");
|
|
4989
|
-
return {
|
|
4990
|
-
requestId: slot.requestId,
|
|
4991
|
-
status: slot.status,
|
|
4992
|
-
text: slot.text,
|
|
4993
|
-
error: slot.error,
|
|
4994
|
-
startedAt: slot.startedAt,
|
|
4995
|
-
finishedAt: slot.finishedAt
|
|
4996
|
-
};
|
|
4997
|
-
});
|
|
4998
|
-
rpc.registerHandler("btw-cancel", async (request) => {
|
|
4999
|
-
const id = typeof request?.requestId === "string" ? request.requestId : "";
|
|
5000
|
-
const slot = slots.get(id);
|
|
5001
|
-
if (!slot || slot.status !== "running") return { cancelled: false };
|
|
5002
|
-
slot.abort.abort("cancelled by user");
|
|
5003
|
-
finish(slot, "cancelled");
|
|
5004
|
-
return { cancelled: true };
|
|
5005
|
-
});
|
|
5006
|
-
return {
|
|
5007
|
-
/** Test/introspection hook. */
|
|
5008
|
-
_slots: slots
|
|
5009
|
-
};
|
|
5010
|
-
}
|
|
5011
|
-
|
|
5012
4722
|
function replayClaudeForkJsonl(file, sink) {
|
|
5013
4723
|
let replayed = 0;
|
|
5014
4724
|
for (const line of file.split("\n")) {
|
|
@@ -5331,6 +5041,9 @@ exports.contentLogMetadata = contentLogMetadata.contentLogMetadata;
|
|
|
5331
5041
|
exports.RawJSONLinesSchema = types.RawJSONLinesSchema;
|
|
5332
5042
|
exports.getProjectPath = path.getProjectPath;
|
|
5333
5043
|
exports.createSessionScanner = sessionScanner.createSessionScanner;
|
|
5044
|
+
exports.describePendingApprovals = registerSideQuestionHandler.describePendingApprovals;
|
|
5045
|
+
exports.registerSideQuestionHandler = registerSideQuestionHandler.registerSideQuestionHandler;
|
|
5046
|
+
exports.writeSideQuestionSettingsFile = registerSideQuestionHandler.writeSideQuestionSettingsFile;
|
|
5334
5047
|
exports.MessageQueue2 = registerKillSessionHandler.MessageQueue2;
|
|
5335
5048
|
exports.registerKillSessionHandler = registerKillSessionHandler.registerKillSessionHandler;
|
|
5336
5049
|
exports.getEnvironmentInfo = doctor.getEnvironmentInfo;
|
|
@@ -5358,10 +5071,8 @@ exports.prewarmCacheFile = prewarmCacheFile;
|
|
|
5358
5071
|
exports.prewarmPredictionMeta = prewarmPredictionMeta;
|
|
5359
5072
|
exports.prewarmSlotDir = prewarmSlotDir;
|
|
5360
5073
|
exports.readPrewarmCache = readPrewarmCache;
|
|
5361
|
-
exports.registerSideQuestionHandler = registerSideQuestionHandler;
|
|
5362
5074
|
exports.replayClaudeForkJsonl = replayClaudeForkJsonl;
|
|
5363
5075
|
exports.resolveMessageMode = resolveMessageMode;
|
|
5364
5076
|
exports.startHookServer = startHookServer;
|
|
5365
5077
|
exports.withAssistantDenylist = withAssistantDenylist;
|
|
5366
5078
|
exports.writePrewarmCache = writePrewarmCache;
|
|
5367
|
-
exports.writeSideQuestionSettingsFile = writeSideQuestionSettingsFile;
|