very-happy-cli 0.2.189 → 0.2.191
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-fj16v_cf.mjs → AcpBackend-CCy_9AfR.mjs} +3 -3
- package/dist/{AcpBackend-DRPJ2g9G.cjs → AcpBackend-DgrIc1vH.cjs} +3 -3
- package/dist/{AcpSessionManager-BZPmUDL5.mjs → AcpSessionManager-CQnxx7gD.mjs} +2 -2
- package/dist/{AcpSessionManager-DM-KKg6v.cjs → AcpSessionManager-DVOzCD3P.cjs} +2 -2
- package/dist/{BasePermissionHandler-DjM16uJz.cjs → BasePermissionHandler-C9Ag7yvs.cjs} +1 -1
- package/dist/{BasePermissionHandler-CVtH-snr.mjs → BasePermissionHandler-DYLN6Ec9.mjs} +1 -1
- package/dist/{acpSessionResume-Dxl1LRAT.mjs → acpSessionResume-Bi7pA1n_.mjs} +1 -1
- package/dist/{acpSessionResume-2BTMsB7_.cjs → acpSessionResume-TvP_4Zq2.cjs} +1 -1
- package/dist/{agentHome-CHctmMzZ.mjs → agentHome-DGv105SR.mjs} +4 -4
- package/dist/{agentHome-W17n1gnH.cjs → agentHome-DNUKJWOY.cjs} +4 -4
- package/dist/{api-BDuuyys8.cjs → api-BBxZ7y2z.cjs} +19 -10
- package/dist/{api-B0yN68XH.mjs → api-jfeMRg5R.mjs} +19 -10
- package/dist/{apiMachine-mc9CsKuS.mjs → apiMachine-DRJ7y-BB.mjs} +56 -15
- package/dist/{apiMachine-iddD-F19.cjs → apiMachine-DqyjKBZG.cjs} +56 -15
- package/dist/{attachmentContent-Cc5b7TPr.cjs → attachmentContent-BO2njyza.cjs} +2 -2
- package/dist/{attachmentContent-CcIdMfAx.mjs → attachmentContent-Dm_RIs5L.mjs} +2 -2
- package/dist/{auth-DNAgkUkB.mjs → auth-BYDtjVNb.mjs} +8 -8
- package/dist/{auth-CyrVvWHF.mjs → auth-DC6rg8lJ.mjs} +5 -5
- package/dist/{auth-B7tVmyfX.cjs → auth-DLR3ksCF.cjs} +8 -8
- package/dist/{auth-DQKSpaEf.cjs → auth-DnxoVkkf.cjs} +5 -5
- package/dist/{auto-CetlumDo.cjs → auto-CwO0u8hB.cjs} +18 -18
- package/dist/{auto-BklCipw1.mjs → auto-D5Jhukq1.mjs} +18 -18
- package/dist/{bootstrap-DfXwkUQb.mjs → bootstrap-rLaL3kTa.mjs} +2 -2
- package/dist/{bootstrap-CDY-Vz8q.cjs → bootstrap-sly4qPPY.cjs} +2 -2
- package/dist/{browser-D1yzC0Tu.cjs → browser-BTgZ9d4i.cjs} +1 -1
- package/dist/{browser-vb0k1zfI.mjs → browser-CHpVgyni.mjs} +1 -1
- package/dist/{claudeLocal-2dJIiTIq.cjs → claudeLocal-1vuTFcL8.cjs} +5 -5
- package/dist/{claudeLocal-Bid_rC_v.mjs → claudeLocal-Bgb5GGsq.mjs} +5 -5
- package/dist/{claudeLocalLauncher-Jm5oQX5Z.cjs → claudeLocalLauncher-DOsL6HFY.cjs} +10 -10
- package/dist/{claudeLocalLauncher-5pzpETxd.mjs → claudeLocalLauncher-T7EfT68h.mjs} +10 -10
- package/dist/{claudeSessionFork-DzecSBO4.mjs → claudeSessionFork-CPvi6yDX.mjs} +1 -1
- package/dist/{claudeSessionFork-DsbcuDEJ.cjs → claudeSessionFork-Cko4SaVi.cjs} +1 -1
- package/dist/{client-CvjjadIE.mjs → client-BXD66ZF5.mjs} +2 -2
- package/dist/{client-C9Ecbtko.mjs → client-Bh1aUPh-.mjs} +4 -4
- package/dist/{client-B161HwAk.mjs → client-Bi20Ka0h.mjs} +2 -2
- package/dist/{client-D0aYWt53.cjs → client-BscskEBk.cjs} +2 -2
- package/dist/{client-BNmFaRXZ.cjs → client-C-OdTbrU.cjs} +4 -4
- package/dist/{client-DIfxYk7B.cjs → client-C5-C0t2a.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +16 -16
- package/dist/codex/happyMcpStdioBridge.mjs +16 -16
- package/dist/{codexAppServerClient-CO9f4Jr8.cjs → codexAppServerClient-DKXeikEe.cjs} +13 -6
- package/dist/{codexAppServerClient-BlVmpjR-.mjs → codexAppServerClient-DXhAf6i-.mjs} +13 -6
- package/dist/{codexCommand-CAMR4g5o.mjs → codexCommand-CIaOiiOj.mjs} +137 -55
- package/dist/{codexCommand-BfoRP6E9.cjs → codexCommand-DvbbpYBS.cjs} +141 -59
- package/dist/{codexTermination-BvGlN02_.mjs → codexTermination-BcQdEDaw.mjs} +1 -1
- package/dist/{codexTermination-IrLZQzKC.cjs → codexTermination-BszWfyk5.cjs} +1 -1
- package/dist/{codexThreadFork-DNekT4nQ.cjs → codexThreadFork-5kwoKjMu.cjs} +11 -17
- package/dist/{codexThreadFork-R76RU5H0.mjs → codexThreadFork-DobPd19R.mjs} +11 -17
- package/dist/{config-BGFqQGvh.cjs → config-Di3Cf6js.cjs} +3 -3
- package/dist/{config-CtMgGPvf.mjs → config-OCEcVVK1.mjs} +3 -3
- package/dist/{configuration-C0ctLGW2.cjs → configuration-DfPBa-9d.cjs} +1 -1
- package/dist/{configuration-1FabKklB.mjs → configuration-ECqXu34R.mjs} +1 -1
- package/dist/{connect-DSw-2f52.cjs → connect-BPQRuOw5.cjs} +13 -13
- package/dist/{connect-0lSugpjf.mjs → connect-BTfAUhk8.mjs} +13 -13
- package/dist/{context-BgxbXWKS.mjs → context-CfgTFpCB.mjs} +1 -1
- package/dist/{context-D-hEk5pC.cjs → context-Co7hUaW-.cjs} +1 -1
- package/dist/{controlClient-F7hAEEy2.cjs → controlClient-C13_pSKG.cjs} +3 -3
- package/dist/{controlClient-DwNnNAUx.mjs → controlClient-ClI7A0qE.mjs} +3 -3
- package/dist/{createSessionMetadata-CG6Klinp.mjs → createSessionMetadata-B0eT_Kfj.mjs} +2 -2
- package/dist/{createSessionMetadata-DezS33OM.cjs → createSessionMetadata-Cf78KHtt.cjs} +2 -2
- package/dist/defaultPermissionMode-m6z2QVyP.mjs +43 -0
- package/dist/defaultPermissionMode-oqTupStc.cjs +49 -0
- package/dist/{deterministicJson-BMwgK21e.mjs → deterministicJson-BtSwbsok.mjs} +13 -13
- package/dist/{deterministicJson-D0LU_XbO.cjs → deterministicJson-CpFFgUL_.cjs} +13 -13
- package/dist/{doctor-wVNvRarN.cjs → doctor-BEU0_1Xv.cjs} +7 -7
- package/dist/{doctor-D16hySse.mjs → doctor-lsxmAK4o.mjs} +7 -7
- package/dist/{downloadTarget-C6tqaXGm.mjs → downloadTarget-BXqXhNF7.mjs} +6 -6
- package/dist/{downloadTarget-aNcCxVRL.cjs → downloadTarget-CikzJv1h.cjs} +6 -6
- package/dist/{ensureDaemonRunning-CIghxgDR.cjs → ensureDaemonRunning-BUuH-pbE.cjs} +5 -5
- package/dist/{ensureDaemonRunning-DZq8bvsp.mjs → ensureDaemonRunning-B_9WAlbU.mjs} +5 -5
- package/dist/exitAfterFlush-AbKNZM0N.mjs +23 -0
- package/dist/exitAfterFlush-DIT_sIxR.cjs +25 -0
- package/dist/{handleResumeCommand-BNnD7EuD.mjs → handleResumeCommand-BK9XKH_l.mjs} +5 -5
- package/dist/{handleResumeCommand-CMUTygsm.cjs → handleResumeCommand-Dj7oi2KO.cjs} +5 -5
- package/dist/{agentAttachments-Dbw8iMCZ.cjs → heldInput-BOtqFO2r.cjs} +27 -0
- package/dist/heldInput-C69lA2dH.mjs +44 -0
- package/dist/{index-BCQr-5Ei.mjs → index-BdOJOZ6J.mjs} +4 -4
- package/dist/{index-CKd20r1W.mjs → index-BjZnpGWX.mjs} +3 -3
- package/dist/{index-WKyN-bNy.mjs → index-Bq8NKSCF.mjs} +65 -1
- package/dist/{index-BOe6dKnL.cjs → index-CLUHaPU8.cjs} +76 -0
- package/dist/{index-CnzsOD19.cjs → index-CauRYQKr.cjs} +133 -54
- package/dist/{index-4TpmBb2Q.cjs → index-CmZusg8Q.cjs} +3 -3
- package/dist/{index-BuiG8hmg.mjs → index-Cxso1rg4.mjs} +133 -54
- package/dist/{index-De02DNu5.cjs → index-D3c7CLot.cjs} +4 -4
- package/dist/{index-B81qV_F_.cjs → index-Dg2NAF_-.cjs} +4 -4
- package/dist/{index-Df0bc_et.mjs → index-DuK9XYbZ.mjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-23ehAdTD.mjs → install-DTIveLOS.mjs} +3 -3
- package/dist/{install-DNbIEJUk.cjs → install-DXllkuy0.cjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +63 -1
- package/dist/lib.d.mts +63 -1
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-B4dHJCeS.cjs → lidState-C9_DoF9i.cjs} +1 -1
- package/dist/{lidState-q5Its2Hm.mjs → lidState-CD81ryTy.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CG2nPD_H.cjs → localHappyAgentAuth-CCjUvOfi.cjs} +1 -1
- package/dist/{localHappyAgentAuth-C_G5u5lY.mjs → localHappyAgentAuth-Cg-m1lwm.mjs} +1 -1
- package/dist/{logger-BP1SW7Cs.cjs → logger-Ct2zvaq0.cjs} +2 -2
- package/dist/{logger-DOKH3Zbh.mjs → logger-GcbI0eg2.mjs} +2 -2
- package/dist/{machineMetadata-D-5qeIqd.mjs → machineMetadata-CXRmFNOV.mjs} +3 -3
- package/dist/{machineMetadata-BKX3ov9g.cjs → machineMetadata-DDCVWb_x.cjs} +3 -3
- package/dist/{main-ndpVIaSG.cjs → main-BHC-WIcM.cjs} +49 -48
- package/dist/{main-DODz8DQE.mjs → main-omGr_ONk.mjs} +49 -48
- package/dist/{mcp-BBwbSODp.mjs → mcp-D5hxmRAq.mjs} +15 -15
- package/dist/{mcp-Bc4U4exu.cjs → mcp-xUzii0m8.cjs} +15 -15
- package/dist/{mirrorProtocol-CiA3hO2y.cjs → mirrorProtocol-Dfl8Ahyf.cjs} +3 -3
- package/dist/{mirrorProtocol-D2vTWteS.mjs → mirrorProtocol-Lcx20Oby.mjs} +3 -3
- package/dist/{package-CYDdLA6R.cjs → package-9n7wd2dT.cjs} +7 -7
- package/dist/{package-DTcaIhjW.mjs → package-BsUHyqWe.mjs} +7 -7
- package/dist/{panels-C2xZ8rqU.cjs → panels-BfknEmt7.cjs} +5 -5
- package/dist/{panels-DCaLxlSL.mjs → panels-CpEKWWbI.mjs} +5 -5
- package/dist/{peerTools-B4315xjX.cjs → peerTools-CElYh-5u.cjs} +5 -5
- package/dist/{peerTools-BtrUnSwz.mjs → peerTools-CwCe6tmJ.mjs} +5 -5
- package/dist/{persistence-CrzC7yr_.cjs → persistence-A2NeERZJ.cjs} +6 -2
- package/dist/{persistence-0INrP3aB.mjs → persistence-Cpw4yJs8.mjs} +6 -3
- package/dist/{piRunnerArgs-BtzW_kfh.cjs → piRunnerArgs-BnFU0K73.cjs} +1 -1
- package/dist/{piRunnerArgs-DRuxMlX1.mjs → piRunnerArgs-Bqmu16He.mjs} +1 -1
- package/dist/{piRuntime-BMAFpIBV.mjs → piRuntime-Cgn1b0OX.mjs} +1 -1
- package/dist/{piRuntime-DEbPE_kW.cjs → piRuntime-DpS9TAIs.cjs} +1 -1
- package/dist/{piTerminal-DQXV8_we.mjs → piTerminal-BGdps8f3.mjs} +17 -17
- package/dist/{piTerminal-MtxDtBE2.cjs → piTerminal-rmve-VlI.cjs} +17 -17
- package/dist/{pushNotifications-CalIS9sq.cjs → pushNotifications-23YSd-0l.cjs} +28 -3
- package/dist/{pushNotifications-Cq1s8YVK.mjs → pushNotifications-XAM8__Pg.mjs} +28 -3
- package/dist/{query-BYiPBHPC.mjs → query-SZcYnJoW.mjs} +1 -1
- package/dist/{query-CE2XDhhw.cjs → query-u2GX-I0C.cjs} +1 -1
- package/dist/{rateLimitReporter-DR5LXuiQ.mjs → rateLimitReporter-COUkf446.mjs} +3 -3
- package/dist/{rateLimitReporter-BKmoOZQi.cjs → rateLimitReporter-CaTzBe3x.cjs} +3 -3
- package/dist/{rateLimitWindows-Cs56YJCH.cjs → rateLimitWindows-B2Kx6L0S.cjs} +1 -1
- package/dist/{rateLimitWindows-5vIuNjko.mjs → rateLimitWindows-j_qQk0KY.mjs} +1 -1
- package/dist/{registerCommonHandlers-DZPozYxc.cjs → registerCommonHandlers-D1MiSfcB.cjs} +2 -2
- package/dist/{registerCommonHandlers-DWkTysjD.mjs → registerCommonHandlers-DRRfinzK.mjs} +2 -2
- package/dist/{registerKillSessionHandler-CSCTRIbI.mjs → registerKillSessionHandler-Cpug_r5C.mjs} +16 -6
- package/dist/{registerKillSessionHandler-DhCjrs44.cjs → registerKillSessionHandler-hvCsEn7b.cjs} +16 -6
- package/dist/{remoteSessionClient-Dq8XTLQP.cjs → remoteSessionClient-6ymeMVa4.cjs} +5 -5
- package/dist/{remoteSessionClient-Vfj_5g2-.mjs → remoteSessionClient-BdnJ_n8C.mjs} +5 -5
- package/dist/{reportProgressTool-B7zmX7NJ.mjs → reportProgressTool-XgQBzxoD.mjs} +3 -3
- package/dist/{reportProgressTool-DznxPKES.cjs → reportProgressTool-tzQLCLIw.cjs} +3 -3
- package/dist/{run-DSfNcR62.mjs → run-Bt0AklUU.mjs} +396 -43
- package/dist/{run-Ca8BiNCp.cjs → run-DYL_wuj7.cjs} +396 -43
- package/dist/{runClaude-hoepv-0X.mjs → runClaude-C3rii_S6.mjs} +47 -27
- package/dist/{runClaude-ClQQcgoO.cjs → runClaude-CBEpYO4S.cjs} +49 -29
- package/dist/{runClaudeDeps-ck5_GYlP.cjs → runClaudeDeps-CYuozSC6.cjs} +187 -61
- package/dist/{runClaudeDeps-D_v8t2SK.mjs → runClaudeDeps-DlVfMG4F.mjs} +192 -66
- package/dist/{runGemini-Cj0XsMiM.cjs → runGemini-CEI3b90u.cjs} +33 -33
- package/dist/{runGemini-CTr2-cYG.mjs → runGemini-DkYhRk9S.mjs} +33 -33
- package/dist/{runOpenClaw-BoN1e3lP.cjs → runOpenClaw-BgjD6E4d.cjs} +18 -18
- package/dist/{runOpenClaw-CdDMntiV.mjs → runOpenClaw-DpprWCoz.mjs} +18 -18
- package/dist/{sandbox-DcaWB-Ou.mjs → sandbox-DJ7A7lsy.mjs} +4 -4
- package/dist/{sandbox-BY2h19gc.cjs → sandbox-XCDUbH72.cjs} +4 -4
- package/dist/{selfCheck-DFS_GUaQ.cjs → selfCheck-BYUDB1Uq.cjs} +37 -37
- package/dist/selfCheck-C-rNljKV.mjs +86 -0
- package/dist/{send-UBTHHNvZ.mjs → send-Ba63huxv.mjs} +8 -8
- package/dist/{send-BMsUYU6g.cjs → send-CASDBCyJ.cjs} +8 -8
- package/dist/{server-YrHMHNz1.cjs → server-cZoV9XRt.cjs} +6 -6
- package/dist/{server-Dt3mCtfQ.mjs → server-w3W0toNd.mjs} +4 -4
- package/dist/{sessionLock-DSqiP2lH.cjs → sessionLock-BmLA2S8K.cjs} +134 -3
- package/dist/{sessionLock-tEFvFXLD.mjs → sessionLock-G2PMqvsh.mjs} +121 -4
- package/dist/{sessionOps-CljctDs5.mjs → sessionOps-DPw5k8vV.mjs} +15 -5
- package/dist/{sessionOps-BzeOKIEF.cjs → sessionOps-DXlTmS7J.cjs} +15 -4
- package/dist/{sessionProvider-BnUFSJXM.mjs → sessionProvider-DUn91LhJ.mjs} +5 -5
- package/dist/{sessionProvider-ORgzmkXy.cjs → sessionProvider-Dg691XQ4.cjs} +5 -5
- package/dist/{sessionScanner-Cr6PJ3PT.cjs → sessionScanner-AHjnicxi.cjs} +3 -3
- package/dist/{sessionScanner-DZUlkdF6.mjs → sessionScanner-BCXpdZJN.mjs} +3 -3
- package/dist/{sessions-aIo_HjmY.cjs → sessions-BiBXOBx0.cjs} +36 -25
- package/dist/{sessions-15cag-su.mjs → sessions-Clk8MR5Y.mjs} +35 -26
- package/dist/{setupOfflineReconnection-tV0Q1dgR.cjs → setupOfflineReconnection-BKLfOd-i.cjs} +2 -2
- package/dist/{setupOfflineReconnection-B7I8R2Ex.mjs → setupOfflineReconnection-DI-QZGYz.mjs} +2 -2
- package/dist/{spawn-ByrQgruJ.mjs → spawn-4tsp1uhh.mjs} +15 -15
- package/dist/{spawn-VG-HjJiR.cjs → spawn-D5omsx1Q.cjs} +15 -15
- package/dist/{spawnAgents-Bh1RPShN.mjs → spawnAgents-CjoU6ZOS.mjs} +8 -2
- package/dist/{spawnAgents-C1-4m7aN.cjs → spawnAgents-CtkkIFHd.cjs} +8 -2
- package/dist/{spawnHappyCLI-CxiR2Qoy.cjs → spawnHappyCLI-CF_gLi92.cjs} +1 -1
- package/dist/{spawnHappyCLI-CEsXwz5V.mjs → spawnHappyCLI-CIA9Sc_5.mjs} +1 -1
- package/dist/{startFileWatcher-C-XCZ5t2.cjs → startFileWatcher-9Stpxe7p.cjs} +1 -1
- package/dist/{startFileWatcher-DkEeeAtL.mjs → startFileWatcher-CDO6fb2m.mjs} +1 -1
- package/dist/{defaultPermissionMode-e2bIIJG4.mjs → startupSessionCreate-BtR4iYEC.mjs} +25 -6
- package/dist/{defaultPermissionMode-5EvgRq38.cjs → startupSessionCreate-CcF7rGGB.cjs} +25 -7
- package/dist/{streamRelay-D9a4cBEa.cjs → streamRelay-BhI6jqF-.cjs} +1 -1
- package/dist/{streamRelay-CqBynIon.mjs → streamRelay-DMwOMTKf.mjs} +1 -1
- package/dist/{sync-CoChLEIg.cjs → sync-Ba8N6xba.cjs} +1 -1
- package/dist/{sync-BvDMkKAN.mjs → sync-C0PRuTMj.mjs} +1 -1
- package/dist/{systemPrompt-CgDaPigN.mjs → systemPrompt-D0q8eyjy.mjs} +2 -2
- package/dist/{systemPrompt-Dy_Rf-0Z.cjs → systemPrompt-DV5IReD4.cjs} +2 -2
- package/dist/{teams-BC4_e5hR.mjs → teams-BO3_arwM.mjs} +7 -7
- package/dist/{teams-DPvfLAk8.cjs → teams-z3Gp-KlV.cjs} +7 -7
- package/dist/{template-17HATY_Y.cjs → template-B_5l6pkc.cjs} +1 -1
- package/dist/{template-CEK8MEjo.mjs → template-DLR_0hfj.mjs} +1 -1
- package/dist/{time-XwEZxKGc.cjs → time-Cy0a-7YX.cjs} +1 -1
- package/dist/{time-CUK37wiV.mjs → time-D0jvDRhn.mjs} +1 -1
- package/dist/{titleGenerator-DWRVdqMU.mjs → titleGenerator-AGQsXskb.mjs} +1 -1
- package/dist/{titleGenerator-DVX0NZUn.cjs → titleGenerator-RGHWP2YL.cjs} +2 -2
- package/dist/{todo-BNMGXneA.mjs → todo-BZ954vsz.mjs} +6 -6
- package/dist/{todo-CKGrSrRE.cjs → todo-CzIDPLFy.cjs} +6 -6
- package/dist/{tools-CjMafO_D.cjs → tools-B1x1j6tz.cjs} +1 -1
- package/dist/{tools-CCIEAVbB.mjs → tools-Bei5i03L.mjs} +1 -1
- package/dist/{uninstall-CJvJ7gjr.mjs → uninstall-B4T_e3Mr.mjs} +3 -3
- package/dist/{uninstall-BdFbTXnL.cjs → uninstall-C3cnIvz1.cjs} +3 -3
- package/package.json +7 -7
- package/dist/agentAttachments-M_B5qEF2.mjs +0 -18
- package/dist/selfCheck-BQ_H2Sns.mjs +0 -86
- package/dist/startupSessionCreate-CYc8mra-.cjs +0 -26
- package/dist/startupSessionCreate-npXe2TdN.mjs +0 -24
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
2
|
import { spawn } from 'cross-spawn';
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
|
-
import { l as logger } from './logger-
|
|
4
|
+
import { l as logger } from './logger-GcbI0eg2.mjs';
|
|
5
5
|
import { e as errorLogMetadata, c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
6
6
|
import { i as initializeSandbox, w as wrapForMcpTransport } from './manager-BEsI4qt3.mjs';
|
|
7
|
-
import { p as packageJson } from './package-
|
|
8
|
-
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-
|
|
7
|
+
import { p as packageJson } from './package-BsUHyqWe.mjs';
|
|
8
|
+
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-j_qQk0KY.mjs';
|
|
9
9
|
import { s as stopProcessGracefully, k as killProcessTree } from './processTree-CP5IvQ2Z.mjs';
|
|
10
10
|
|
|
11
11
|
const CODEX_HELPER_LABEL_MAX_CHARS = 80;
|
|
@@ -125,6 +125,8 @@ class CodexAppServerClient {
|
|
|
125
125
|
pending = /* @__PURE__ */ new Map();
|
|
126
126
|
processEpoch = 0;
|
|
127
127
|
connected = false;
|
|
128
|
+
/** B-852: agent version from the last `initialize` (null = unknown). */
|
|
129
|
+
serverVersion = null;
|
|
128
130
|
sandboxConfig;
|
|
129
131
|
sandboxCleanup = null;
|
|
130
132
|
sandboxEnabled = false;
|
|
@@ -625,7 +627,8 @@ ${text}`.slice(-400);
|
|
|
625
627
|
experimentalApi: true
|
|
626
628
|
}
|
|
627
629
|
};
|
|
628
|
-
await this.request("initialize", initParams);
|
|
630
|
+
const initialized = await this.request("initialize", initParams);
|
|
631
|
+
this.serverVersion = typeof initialized?.userAgent === "string" ? initialized.userAgent.match(/\/(\d+\.\d+\.\d+)\b/)?.[1] ?? null : null;
|
|
629
632
|
this.notify("initialized");
|
|
630
633
|
this.connected = true;
|
|
631
634
|
logger.debug("[CodexAppServer] Connected and initialized");
|
|
@@ -811,7 +814,8 @@ ${text}`.slice(-400);
|
|
|
811
814
|
baseInstructions: null,
|
|
812
815
|
developerInstructions: null,
|
|
813
816
|
ephemeral: false,
|
|
814
|
-
threadSource: null
|
|
817
|
+
threadSource: null,
|
|
818
|
+
...opts.lastTurnId ? { lastTurnId: opts.lastTurnId } : {}
|
|
815
819
|
};
|
|
816
820
|
const result = await this.request("thread/fork", params);
|
|
817
821
|
this._threadId = result.thread.id;
|
|
@@ -1118,7 +1122,10 @@ ${text}`.slice(-400);
|
|
|
1118
1122
|
* Returns { aborted: true } if the turn was aborted (user cancel, permission reject, etc.).
|
|
1119
1123
|
*/
|
|
1120
1124
|
async sendTurnAndWait(prompt, opts) {
|
|
1121
|
-
const { aborted } = await this.runTurnAndWait(() =>
|
|
1125
|
+
const { aborted } = await this.runTurnAndWait(async () => {
|
|
1126
|
+
await this.sendTurn(prompt, opts);
|
|
1127
|
+
opts?.onTurnStarted?.();
|
|
1128
|
+
}, opts);
|
|
1122
1129
|
return { aborted };
|
|
1123
1130
|
}
|
|
1124
1131
|
/**
|
|
@@ -1,106 +1,107 @@
|
|
|
1
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { s as
|
|
1
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-DC6rg8lJ.mjs';
|
|
2
|
+
import { j as createEnvelope, t as BUILTIN_TODO_DISCOVERY, r as restoredEffort, m as readEffortIntent, E as EFFORT_INTENT_AUTO, P as PROMPT_QUEUE_CAPABILITY, Y as CODEX_STEER_CAPABILITY, a as PROJECT_SESSION_CAPABILITY, Z as CODEX_COMPACT_CAPABILITY, R as RUN_INTENT_CAPABILITY } from './index-Bq8NKSCF.mjs';
|
|
3
|
+
import { a as recordRunIntents, w as withoutEffort, r as registerRunIntentRpc, b as DEFAULT_CODEX_PERMISSION_MODE } from './defaultPermissionMode-m6z2QVyP.mjs';
|
|
4
|
+
import { h as hashObject, s as startHappyServer, c as createProjectInjector } from './deterministicJson-BtSwbsok.mjs';
|
|
5
|
+
import { s as sharedProjectsClient } from './client-Bi20Ka0h.mjs';
|
|
5
6
|
import { unlink } from 'node:fs/promises';
|
|
6
7
|
import { p as publishForkBackfillWhenCommitted, F as FORK_BACKFILL_CAPABILITY } from './forkBackfill-DYIjlN1Z.mjs';
|
|
7
8
|
import { randomUUID } from 'node:crypto';
|
|
8
9
|
import { createId } from '@paralleldrive/cuid2';
|
|
9
|
-
import { t as textResultPayload, d as toolResultContentText, c as connectionState, A as ApiClient } from './api-
|
|
10
|
-
import { r as registerAgentAttachmentDownloads } from './
|
|
11
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-
|
|
10
|
+
import { t as textResultPayload, d as toolResultContentText, c as connectionState, A as ApiClient } from './api-jfeMRg5R.mjs';
|
|
11
|
+
import { r as registerAgentAttachmentDownloads, H as HeldInput } from './heldInput-C69lA2dH.mjs';
|
|
12
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-Dm_RIs5L.mjs';
|
|
12
13
|
import { useStdout, useInput, Box, Text, render } from 'ink';
|
|
13
|
-
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, e as exitCursorStamp } from './sessionLock-
|
|
14
|
+
import { c as claimSessionOrExit, a as applyServerSnapshot, b as applyReconnectReplay, w as withoutServerSnapshot, m as mergeReconnectMetadata, t as takeAutoRestartedEvent, A as AUTO_RESTART_CAPABILITY, e as exitCursorStamp } from './sessionLock-G2PMqvsh.mjs';
|
|
14
15
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
15
|
-
import { C as CodexAppServerClient } from './codexAppServerClient-
|
|
16
|
-
import { w as wrapperRateLimitReporter } from './rateLimitReporter-
|
|
17
|
-
import { l as logger } from './logger-
|
|
18
|
-
import { B as BasePermissionHandler } from './BasePermissionHandler-
|
|
19
|
-
import { B as BaseReasoningProcessor, s as settleCodexSession } from './codexTermination-
|
|
16
|
+
import { C as CodexAppServerClient } from './codexAppServerClient-DXhAf6i-.mjs';
|
|
17
|
+
import { w as wrapperRateLimitReporter } from './rateLimitReporter-COUkf446.mjs';
|
|
18
|
+
import { l as logger } from './logger-GcbI0eg2.mjs';
|
|
19
|
+
import { B as BasePermissionHandler } from './BasePermissionHandler-DYLN6Ec9.mjs';
|
|
20
|
+
import { B as BaseReasoningProcessor, s as settleCodexSession } from './codexTermination-BcQdEDaw.mjs';
|
|
20
21
|
import { execSync } from 'node:child_process';
|
|
21
|
-
import { r as readSettings, l as latchKeepAwake, e as evaluateWrapperIdle, a as resolveCheckMs, H as HIBERNATION_CAPABILITY } from './persistence-
|
|
22
|
-
import { g as getInitialMachineMetadata } from './machineMetadata-
|
|
23
|
-
import { c as configuration } from './configuration-
|
|
24
|
-
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-
|
|
22
|
+
import { r as readSettings, l as latchKeepAwake, e as evaluateWrapperIdle, a as resolveCheckMs, H as HIBERNATION_CAPABILITY } from './persistence-Cpw4yJs8.mjs';
|
|
23
|
+
import { g as getInitialMachineMetadata } from './machineMetadata-CXRmFNOV.mjs';
|
|
24
|
+
import { c as configuration } from './configuration-ECqXu34R.mjs';
|
|
25
|
+
import { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-Cpug_r5C.mjs';
|
|
25
26
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
26
27
|
import { join } from 'node:path';
|
|
27
|
-
import { c as createSessionMetadata } from './createSessionMetadata-
|
|
28
|
+
import { c as createSessionMetadata } from './createSessionMetadata-B0eT_Kfj.mjs';
|
|
28
29
|
import { M as MessageBuffer } from './sessionExitLifecycle-CzkLIgNZ.mjs';
|
|
29
|
-
import { n as notifyDaemonSessionStarted, k as reportSessionEditToDaemon, c as checkDaemonHibernation } from './controlClient-
|
|
30
|
-
import {
|
|
30
|
+
import { n as notifyDaemonSessionStarted, k as reportSessionEditToDaemon, c as checkDaemonHibernation } from './controlClient-ClI7A0qE.mjs';
|
|
31
|
+
import { c as createSessionForStartup, b as HibernationExitLatch, H as HibernationProbe, a as commitHibernation } from './startupSessionCreate-BtR4iYEC.mjs';
|
|
31
32
|
import { d as decodeBase64, e as encodeBase64 } from './authRelay-DhQhkBvX.mjs';
|
|
32
|
-
import { s as setupOfflineReconnection } from './setupOfflineReconnection-
|
|
33
|
-
import { c as createSessionForStartup } from './startupSessionCreate-npXe2TdN.mjs';
|
|
33
|
+
import { s as setupOfflineReconnection } from './setupOfflineReconnection-DI-QZGYz.mjs';
|
|
34
34
|
import { t as trimIdent } from './trimIdent-BAjmv_TG.mjs';
|
|
35
35
|
import { a as parseSpecialCommand, c as compactCommandText, b as parseCompact } from './specialCommands-MXUN0wfI.mjs';
|
|
36
36
|
import { C as CHANGE_TITLE_INSTRUCTION } from './constants-BC4St0xd.mjs';
|
|
37
37
|
import { E as EditReportThrottle, a as extractCodexPatchPaths } from './editPaths-BVfS_FFL.mjs';
|
|
38
|
-
import { a as extractNoSandboxFlag, e as ensureDaemonRunning } from './ensureDaemonRunning-
|
|
38
|
+
import { a as extractNoSandboxFlag, e as ensureDaemonRunning } from './ensureDaemonRunning-B_9WAlbU.mjs';
|
|
39
39
|
import 'tweetnacl';
|
|
40
40
|
import 'axios';
|
|
41
|
-
import './time-
|
|
42
|
-
import './browser-
|
|
41
|
+
import './time-D0jvDRhn.mjs';
|
|
42
|
+
import './browser-CHpVgyni.mjs';
|
|
43
43
|
import 'open';
|
|
44
44
|
import 'zod';
|
|
45
45
|
import './prompt-QHuFx9j6.mjs';
|
|
46
|
-
import './reportProgressTool-
|
|
47
|
-
import './client-
|
|
46
|
+
import './reportProgressTool-XgQBzxoD.mjs';
|
|
47
|
+
import './client-BXD66ZF5.mjs';
|
|
48
48
|
import './precheckCompat-DeEbilbr.mjs';
|
|
49
49
|
import './agentGuidance-BDYt2Qy2.mjs';
|
|
50
50
|
import 'node:fs';
|
|
51
51
|
import 'node:os';
|
|
52
52
|
import './pi-CqyoZMjI.mjs';
|
|
53
53
|
import './fileStore-5qpetZS0.mjs';
|
|
54
|
-
import './client-
|
|
54
|
+
import './client-Bh1aUPh-.mjs';
|
|
55
55
|
import 'node:util';
|
|
56
|
-
import './context-
|
|
57
|
-
import './sessionOps-
|
|
56
|
+
import './context-CfgTFpCB.mjs';
|
|
57
|
+
import './sessionOps-DPw5k8vV.mjs';
|
|
58
58
|
import 'socket.io-client';
|
|
59
59
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
60
60
|
import './resources-CLP_MpK4.mjs';
|
|
61
|
-
import './tools-
|
|
62
|
-
import './peerTools-
|
|
61
|
+
import './tools-Bei5i03L.mjs';
|
|
62
|
+
import './peerTools-CwCe6tmJ.mjs';
|
|
63
63
|
import './ids-DU6sLx4C.mjs';
|
|
64
|
-
import './remoteSessionClient-
|
|
64
|
+
import './remoteSessionClient-BdnJ_n8C.mjs';
|
|
65
65
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
66
66
|
import 'node:http';
|
|
67
67
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
68
68
|
import './limits-DIo7rEBR.mjs';
|
|
69
|
-
import './downloadTarget-
|
|
69
|
+
import './downloadTarget-BXqXhNF7.mjs';
|
|
70
70
|
import './terminals-Dlg0x3nY.mjs';
|
|
71
71
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
72
72
|
import './tmuxSocket-B8Yx20sT.mjs';
|
|
73
|
-
import './bootstrap-
|
|
74
|
-
import './package-
|
|
73
|
+
import './bootstrap-rLaL3kTa.mjs';
|
|
74
|
+
import './package-BsUHyqWe.mjs';
|
|
75
75
|
import './webPanels-B2_C2-3g.mjs';
|
|
76
|
-
import './pushNotifications-
|
|
76
|
+
import './pushNotifications-XAM8__Pg.mjs';
|
|
77
77
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
78
78
|
import './previewPath-CXN4Vag0.mjs';
|
|
79
79
|
import 'crypto';
|
|
80
|
-
import './lidState-
|
|
80
|
+
import './lidState-CD81ryTy.mjs';
|
|
81
81
|
import 'os';
|
|
82
82
|
import 'child_process';
|
|
83
83
|
import 'node:events';
|
|
84
|
-
import './registerCommonHandlers-
|
|
84
|
+
import './registerCommonHandlers-DRRfinzK.mjs';
|
|
85
85
|
import 'util';
|
|
86
86
|
import 'fs/promises';
|
|
87
87
|
import 'path';
|
|
88
88
|
import 'cross-spawn';
|
|
89
|
-
import './sync-
|
|
89
|
+
import './sync-C0PRuTMj.mjs';
|
|
90
90
|
import 'chalk';
|
|
91
|
+
import './cliUpdate-Y34VGe9Y.mjs';
|
|
91
92
|
import './processTreeSnapshot-CuLJDNC-.mjs';
|
|
92
93
|
import 'node:readline';
|
|
93
94
|
import './manager-BEsI4qt3.mjs';
|
|
94
95
|
import '@anthropic-ai/sandbox-runtime';
|
|
95
|
-
import './rateLimitWindows-
|
|
96
|
+
import './rateLimitWindows-j_qQk0KY.mjs';
|
|
96
97
|
import './processTree-CP5IvQ2Z.mjs';
|
|
97
98
|
import './detectCLI-CSGMlV51.mjs';
|
|
98
99
|
import 'fs';
|
|
99
|
-
import './localHappyAgentAuth-
|
|
100
|
+
import './localHappyAgentAuth-Cg-m1lwm.mjs';
|
|
100
101
|
import './fsMkdir-DumgLTzR.mjs';
|
|
101
102
|
import './types-CkqAACXx.mjs';
|
|
102
103
|
import 'url';
|
|
103
|
-
import './spawnHappyCLI-
|
|
104
|
+
import './spawnHappyCLI-CIA9Sc_5.mjs';
|
|
104
105
|
import './doctorReadiness-C208SMN9.mjs';
|
|
105
106
|
|
|
106
107
|
function getStartedSubagents(state) {
|
|
@@ -1094,6 +1095,13 @@ function unsupportedEffortReason(catalog, model, effort) {
|
|
|
1094
1095
|
if (selected.supportedReasoningEfforts.some((option) => option.reasoningEffort === effort)) return null;
|
|
1095
1096
|
return `Reasoning effort "${effort}" is not supported by ${model ?? "the default model"}. Choose a supported level.`;
|
|
1096
1097
|
}
|
|
1098
|
+
function settleTurnEffort(catalog, model, effort, opts) {
|
|
1099
|
+
const refusal = unsupportedEffortReason(catalog, model, effort);
|
|
1100
|
+
if (!refusal) return { refusal: null, effort, changed: false };
|
|
1101
|
+
const catalogDefault = catalog.find((entry) => model ? entry.model === model : entry.isDefault)?.defaultReasoningEffort ?? void 0;
|
|
1102
|
+
const settled = !unsupportedEffortReason(catalog, model, opts.fallback) ? opts.fallback : catalogDefault && !unsupportedEffortReason(catalog, model, catalogDefault) ? catalogDefault : void 0;
|
|
1103
|
+
return { refusal: opts.explicit ? refusal : null, effort: settled, changed: true };
|
|
1104
|
+
}
|
|
1097
1105
|
|
|
1098
1106
|
function resolveCodexTurnModel(mode, machineDefault) {
|
|
1099
1107
|
if (mode.model) return mode.model;
|
|
@@ -1497,11 +1505,13 @@ async function runCodex(opts) {
|
|
|
1497
1505
|
dangerouslySkipPermissions: initialPermissionMode === "yolo" || initialPermissionMode === "bypassPermissions",
|
|
1498
1506
|
...forkedFromSessionId ? { parentSessionId: forkedFromSessionId } : {},
|
|
1499
1507
|
...forkedFromMessageId ? { forkedFromMessageId } : {},
|
|
1500
|
-
capabilities: [PROMPT_QUEUE_CAPABILITY, FORK_BACKFILL_CAPABILITY, HIBERNATION_CAPABILITY, CODEX_STEER_CAPABILITY, PROJECT_SESSION_CAPABILITY, CODEX_COMPACT_CAPABILITY]
|
|
1508
|
+
capabilities: [PROMPT_QUEUE_CAPABILITY, FORK_BACKFILL_CAPABILITY, HIBERNATION_CAPABILITY, AUTO_RESTART_CAPABILITY, CODEX_STEER_CAPABILITY, PROJECT_SESSION_CAPABILITY, CODEX_COMPACT_CAPABILITY, RUN_INTENT_CAPABILITY]
|
|
1501
1509
|
});
|
|
1502
1510
|
metadata.attachmentKinds = [...CLAUDE_ATTACHMENT_KINDS];
|
|
1503
1511
|
metadata.stickyModel = null;
|
|
1504
1512
|
metadata.currentThoughtLevelCode = DEFAULT_CODEX_EFFORT;
|
|
1513
|
+
metadata.modelIntent = null;
|
|
1514
|
+
metadata.effortIntent = null;
|
|
1505
1515
|
const importCodexThreadId = process.env[IMPORT_CODEX_THREAD_ENV];
|
|
1506
1516
|
if (importCodexThreadId) {
|
|
1507
1517
|
metadata.importedFromCodexThreadId = importCodexThreadId;
|
|
@@ -1555,6 +1565,7 @@ async function runCodex(opts) {
|
|
|
1555
1565
|
logger.debug(`[START] Reconnect without server snapshot (${snapshot.reason}); skipping existing messages`);
|
|
1556
1566
|
}
|
|
1557
1567
|
}
|
|
1568
|
+
const resumedEffort = reconnectSeeded && response ? restoredEffort(response.metadata, { useReportedLevel: true }) : void 0;
|
|
1558
1569
|
let session;
|
|
1559
1570
|
let permissionHandler;
|
|
1560
1571
|
let client;
|
|
@@ -1614,9 +1625,13 @@ async function runCodex(opts) {
|
|
|
1614
1625
|
const keys = entries.map((entry) => entry.sourceId).filter((key) => typeof key === "string");
|
|
1615
1626
|
if (keys.length > 0) session.sendQueueCancelReason(keys, entries[0].reason);
|
|
1616
1627
|
});
|
|
1628
|
+
const heldInput = new HeldInput((keys, reason) => session.sendQueueCancelReason(keys, reason));
|
|
1617
1629
|
let currentPermissionMode = initialPermissionMode;
|
|
1618
1630
|
let currentModel = DEFAULT_CODEX_MODEL;
|
|
1619
|
-
let currentEffort = DEFAULT_CODEX_EFFORT;
|
|
1631
|
+
let currentEffort = resumedEffort !== void 0 ? resumedEffort ?? void 0 : DEFAULT_CODEX_EFFORT;
|
|
1632
|
+
let pendingModelReset = false;
|
|
1633
|
+
let lastStartedEffort = currentEffort;
|
|
1634
|
+
const effortJudgeModel = (model, modelReset) => resolveCodexTurnModel({ model, modelReset }, machineDefaultModel) ?? client?.threadModel ?? machineDefaultModel;
|
|
1620
1635
|
let currentAppendSystemPrompt = void 0;
|
|
1621
1636
|
let reportedStickyModel = null;
|
|
1622
1637
|
let reportedCurrentModel;
|
|
@@ -1639,8 +1654,6 @@ async function runCodex(opts) {
|
|
|
1639
1654
|
});
|
|
1640
1655
|
};
|
|
1641
1656
|
const resetCurrentModeDefaults = () => {
|
|
1642
|
-
currentEffort = DEFAULT_CODEX_EFFORT;
|
|
1643
|
-
reportModeFacts();
|
|
1644
1657
|
currentAppendSystemPrompt = void 0;
|
|
1645
1658
|
logger.debug("[Codex] Reset current mode defaults after abort");
|
|
1646
1659
|
};
|
|
@@ -1654,6 +1667,7 @@ async function runCodex(opts) {
|
|
|
1654
1667
|
};
|
|
1655
1668
|
publishPermissionMode(opts.permissionMode);
|
|
1656
1669
|
let discoveredModels = [];
|
|
1670
|
+
let codexAgentVersion = null;
|
|
1657
1671
|
let machineDefaultModel;
|
|
1658
1672
|
registerAgentAttachmentDownloads(session);
|
|
1659
1673
|
const CODEX_IMAGE_MIME_TYPES = ["image/jpeg", "image/png", "image/gif", "image/webp"];
|
|
@@ -1698,9 +1712,13 @@ async function runCodex(opts) {
|
|
|
1698
1712
|
reportModeFacts();
|
|
1699
1713
|
logger.debug("[Codex] Model override updated", logValueMetadata(message.meta.model));
|
|
1700
1714
|
} else {
|
|
1715
|
+
messageModelReset = pendingModelReset && !messageModel;
|
|
1701
1716
|
logger.debug("[Codex] User message received without a model override");
|
|
1702
1717
|
}
|
|
1718
|
+
pendingModelReset = false;
|
|
1703
1719
|
let messageEffort = currentEffort;
|
|
1720
|
+
let effortExplicit = false;
|
|
1721
|
+
let effortRefused = false;
|
|
1704
1722
|
if (message.meta?.hasOwnProperty("effort")) {
|
|
1705
1723
|
const incoming = message.meta.effort;
|
|
1706
1724
|
if (incoming === null || incoming === void 0) {
|
|
@@ -1710,15 +1728,22 @@ async function runCodex(opts) {
|
|
|
1710
1728
|
logger.debug(`[Codex] Effort reset to default`);
|
|
1711
1729
|
} else if (typeof incoming === "string") {
|
|
1712
1730
|
messageEffort = incoming;
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1731
|
+
effortExplicit = true;
|
|
1732
|
+
effortRefused = unsupportedEffortReason(discoveredModels, effortJudgeModel(messageModel, messageModelReset), messageEffort) !== null;
|
|
1733
|
+
if (effortRefused) {
|
|
1734
|
+
logger.debug("[Codex] Effort override refused by the model catalog; sticky level kept", logValueMetadata(incoming));
|
|
1735
|
+
} else {
|
|
1736
|
+
currentEffort = messageEffort;
|
|
1737
|
+
reportModeFacts();
|
|
1738
|
+
logger.debug("[Codex] Valid effort override applied");
|
|
1739
|
+
}
|
|
1716
1740
|
} else {
|
|
1717
1741
|
logger.debug("[Codex] Ignoring invalid effort override", logValueMetadata(incoming));
|
|
1718
1742
|
}
|
|
1719
1743
|
} else {
|
|
1720
1744
|
logger.debug("[Codex] User message received without an effort override");
|
|
1721
1745
|
}
|
|
1746
|
+
recordRunIntents(session, effortRefused ? withoutEffort(message.meta) : message.meta);
|
|
1722
1747
|
let messageAppendSystemPrompt = currentAppendSystemPrompt;
|
|
1723
1748
|
if (message.meta?.hasOwnProperty("appendSystemPrompt")) {
|
|
1724
1749
|
messageAppendSystemPrompt = message.meta.appendSystemPrompt || void 0;
|
|
@@ -1732,7 +1757,8 @@ async function runCodex(opts) {
|
|
|
1732
1757
|
model: messageModel,
|
|
1733
1758
|
...messageModelReset ? { modelReset: true } : {},
|
|
1734
1759
|
appendSystemPrompt: messageAppendSystemPrompt,
|
|
1735
|
-
effort: messageEffort
|
|
1760
|
+
effort: messageEffort,
|
|
1761
|
+
...effortExplicit ? { effortExplicit: true } : {}
|
|
1736
1762
|
};
|
|
1737
1763
|
if (message.meta?.delivery === "steer" && !isCodexControlText(message.content.text)) {
|
|
1738
1764
|
if (await steerIntoRunningTurn(steerDeps, message.content.text, attachments, message.localKey)) {
|
|
@@ -1753,6 +1779,7 @@ async function runCodex(opts) {
|
|
|
1753
1779
|
}).catch((error) => {
|
|
1754
1780
|
logger.warn("[Codex] Failed to prepare user attachments", safeCodexErrorMetadata(error));
|
|
1755
1781
|
session.sendSessionEvent({ type: "message", message: "Could not prepare this message. Please send it again." });
|
|
1782
|
+
if (message.localKey) session.sendQueueCancelReason([message.localKey], "failed");
|
|
1756
1783
|
});
|
|
1757
1784
|
});
|
|
1758
1785
|
let thinking = false;
|
|
@@ -1795,6 +1822,7 @@ async function runCodex(opts) {
|
|
|
1795
1822
|
}
|
|
1796
1823
|
let abortController = new AbortController();
|
|
1797
1824
|
let shouldExit = false;
|
|
1825
|
+
let terminating = false;
|
|
1798
1826
|
const hibernationExit = new HibernationExitLatch((a, b) => a === "archive" && b !== "archive");
|
|
1799
1827
|
let hibernationStamp = null;
|
|
1800
1828
|
let hibernationProbe = null;
|
|
@@ -1848,6 +1876,10 @@ async function runCodex(opts) {
|
|
|
1848
1876
|
logger.debug("[Codex] Kill session requested - terminating process");
|
|
1849
1877
|
const exitCursor = intent === "offline" && session ? exitCursorStamp(session.messageCursor, Date.now()) : void 0;
|
|
1850
1878
|
if (exitCursor) session.freezeInbound();
|
|
1879
|
+
const exitReason = intent === "archive" ? "aborted" : "restarted";
|
|
1880
|
+
terminating = true;
|
|
1881
|
+
heldInput.drop(exitReason);
|
|
1882
|
+
messageQueue.discardAll(exitReason);
|
|
1851
1883
|
await handleAbort("kill");
|
|
1852
1884
|
logger.debug("[Codex] Abort completed, proceeding with termination");
|
|
1853
1885
|
try {
|
|
@@ -1873,6 +1905,24 @@ async function runCodex(opts) {
|
|
|
1873
1905
|
}
|
|
1874
1906
|
});
|
|
1875
1907
|
session.rpcHandlerManager.registerHandler("abort", () => handleAbort("user"));
|
|
1908
|
+
registerRunIntentRpc(session.rpcHandlerManager, {
|
|
1909
|
+
getMetadata: () => session.getMetadata(),
|
|
1910
|
+
updateMetadata: (handler) => session.updateMetadata(handler)
|
|
1911
|
+
}, (request) => {
|
|
1912
|
+
if (Object.prototype.hasOwnProperty.call(request, "model")) {
|
|
1913
|
+
currentModel = request.model || void 0;
|
|
1914
|
+
pendingModelReset = !currentModel;
|
|
1915
|
+
}
|
|
1916
|
+
let effortRefused = false;
|
|
1917
|
+
if (Object.prototype.hasOwnProperty.call(request, "effort")) {
|
|
1918
|
+
const effort = request.effort || void 0;
|
|
1919
|
+
effortRefused = unsupportedEffortReason(discoveredModels, effortJudgeModel(currentModel, pendingModelReset), effort) !== null;
|
|
1920
|
+
if (!effortRefused) currentEffort = effort;
|
|
1921
|
+
}
|
|
1922
|
+
if (client) reportModeFacts();
|
|
1923
|
+
logger.debug("[Codex] Run intent set", logValueMetadata(request.model ?? null));
|
|
1924
|
+
return { effortRefused };
|
|
1925
|
+
});
|
|
1876
1926
|
const disposeTermination = registerKillSessionHandler(session.rpcHandlerManager, () => handleKillSession("archive"), session, { processSignals: true, onSignal: () => handleKillSession("offline") });
|
|
1877
1927
|
const messageBuffer = new MessageBuffer();
|
|
1878
1928
|
const hasTTY = process.stdout.isTTY && process.stdin.isTTY;
|
|
@@ -2073,6 +2123,7 @@ async function runCodex(opts) {
|
|
|
2073
2123
|
logger.debug("[codex]: client.connect begin");
|
|
2074
2124
|
await client.connect();
|
|
2075
2125
|
logger.debug("[codex]: client.connect done");
|
|
2126
|
+
codexAgentVersion = client.serverVersion;
|
|
2076
2127
|
try {
|
|
2077
2128
|
discoveredModels = await client.listModels();
|
|
2078
2129
|
let configured = null;
|
|
@@ -2167,6 +2218,7 @@ async function runCodex(opts) {
|
|
|
2167
2218
|
pendingRequests: Object.keys(session.getAgentState()?.requests ?? {}).length,
|
|
2168
2219
|
backgroundTasks: codexActiveSubagents.size,
|
|
2169
2220
|
lastActivityAt: session.lastActivityAt,
|
|
2221
|
+
...codexAgentVersion ? { agentVersion: codexAgentVersion } : {},
|
|
2170
2222
|
...shouldExit && !hibernationExit.hibernating ? { exiting: true } : {}
|
|
2171
2223
|
};
|
|
2172
2224
|
};
|
|
@@ -2197,6 +2249,8 @@ async function runCodex(opts) {
|
|
|
2197
2249
|
});
|
|
2198
2250
|
hibernationProbe.start();
|
|
2199
2251
|
}
|
|
2252
|
+
const autoUpdated = takeAutoRestartedEvent(process.env, "Codex");
|
|
2253
|
+
if (autoUpdated) session.sendSessionEvent(autoUpdated);
|
|
2200
2254
|
idleRelease.arm();
|
|
2201
2255
|
while (!shouldExit) {
|
|
2202
2256
|
logActiveHandles("loop-top");
|
|
@@ -2214,6 +2268,7 @@ async function runCodex(opts) {
|
|
|
2214
2268
|
break;
|
|
2215
2269
|
}
|
|
2216
2270
|
message = batch;
|
|
2271
|
+
heldInput.hold(batch.sourceIds);
|
|
2217
2272
|
}
|
|
2218
2273
|
if (!message) {
|
|
2219
2274
|
break;
|
|
@@ -2226,6 +2281,7 @@ async function runCodex(opts) {
|
|
|
2226
2281
|
turnActive = true;
|
|
2227
2282
|
if (isCodexClearText(message.message)) {
|
|
2228
2283
|
logger.debug("[Codex] Handling /clear command - resetting Codex thread state");
|
|
2284
|
+
heldInput.delivered();
|
|
2229
2285
|
client.clearThreadState();
|
|
2230
2286
|
currentTurnId = null;
|
|
2231
2287
|
codexStartedSubagents = /* @__PURE__ */ new Set();
|
|
@@ -2262,6 +2318,7 @@ async function runCodex(opts) {
|
|
|
2262
2318
|
try {
|
|
2263
2319
|
if (compactCommand !== null) {
|
|
2264
2320
|
await client.ensureConnected();
|
|
2321
|
+
heldInput.delivered();
|
|
2265
2322
|
const outcome = await runCodexCompact(compactCommand, {
|
|
2266
2323
|
client,
|
|
2267
2324
|
notify: (text) => {
|
|
@@ -2279,9 +2336,23 @@ async function runCodex(opts) {
|
|
|
2279
2336
|
sandboxManagedByHappy
|
|
2280
2337
|
);
|
|
2281
2338
|
const turnModel = resolveCodexTurnModel(message.mode, machineDefaultModel);
|
|
2282
|
-
const
|
|
2283
|
-
|
|
2284
|
-
|
|
2339
|
+
const turnEffort = settleTurnEffort(discoveredModels, turnModel ?? client.threadModel ?? machineDefaultModel, message.mode.effort, {
|
|
2340
|
+
explicit: message.mode.effortExplicit === true,
|
|
2341
|
+
fallback: lastStartedEffort
|
|
2342
|
+
});
|
|
2343
|
+
if (turnEffort.changed) {
|
|
2344
|
+
const refused = message.mode.effort;
|
|
2345
|
+
if (currentEffort === refused) {
|
|
2346
|
+
currentEffort = turnEffort.effort;
|
|
2347
|
+
reportModeFacts();
|
|
2348
|
+
}
|
|
2349
|
+
if (readEffortIntent(session.getMetadata()?.effortIntent) === refused) {
|
|
2350
|
+
recordRunIntents(session, { effort: turnEffort.effort ?? null, effortIntent: turnEffort.effort ?? EFFORT_INTENT_AUTO });
|
|
2351
|
+
}
|
|
2352
|
+
logger.debug("[Codex] Refused effort settled", logValueMetadata(turnEffort.effort ?? null));
|
|
2353
|
+
}
|
|
2354
|
+
if (turnEffort.refusal) {
|
|
2355
|
+
throw new Error(turnEffort.refusal);
|
|
2285
2356
|
}
|
|
2286
2357
|
if (!client.hasActiveThread()) {
|
|
2287
2358
|
const startedThread = await client.startThread({
|
|
@@ -2310,12 +2381,20 @@ async function runCodex(opts) {
|
|
|
2310
2381
|
happyHomeDir: configuration.happyHomeDir,
|
|
2311
2382
|
sessionId: session.sessionId
|
|
2312
2383
|
}) : [];
|
|
2384
|
+
if (terminating) {
|
|
2385
|
+
logger.debug("[Codex] Session is ending; not starting the turn");
|
|
2386
|
+
continue;
|
|
2387
|
+
}
|
|
2313
2388
|
const result = await client.sendTurnAndWait(appendStagedAttachmentsToPrompt(turnPrompt, staged), {
|
|
2314
2389
|
images: staged.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => file.path),
|
|
2315
2390
|
model: turnModel,
|
|
2316
2391
|
approvalPolicy: executionPolicy.approvalPolicy,
|
|
2317
2392
|
sandbox: executionPolicy.sandbox,
|
|
2318
|
-
effort:
|
|
2393
|
+
effort: turnEffort.effort,
|
|
2394
|
+
onTurnStarted: () => {
|
|
2395
|
+
lastStartedEffort = turnEffort.effort;
|
|
2396
|
+
heldInput.delivered();
|
|
2397
|
+
}
|
|
2319
2398
|
});
|
|
2320
2399
|
reportModeFacts();
|
|
2321
2400
|
first = false;
|
|
@@ -2327,6 +2406,7 @@ async function runCodex(opts) {
|
|
|
2327
2406
|
}
|
|
2328
2407
|
} catch (error) {
|
|
2329
2408
|
logger.warn("Error in codex session", safeCodexErrorMetadata(error));
|
|
2409
|
+
if (heldInput.drop("failed")) logger.debug("[Codex] Message failed before its turn started; tombstoned");
|
|
2330
2410
|
const reason = describeThrownTurnError(error);
|
|
2331
2411
|
if (reason) {
|
|
2332
2412
|
messageBuffer.addMessage(`Task failed: ${reason}`, "status");
|
|
@@ -2358,6 +2438,8 @@ async function runCodex(opts) {
|
|
|
2358
2438
|
disposeTermination?.();
|
|
2359
2439
|
hibernationProbe?.stop();
|
|
2360
2440
|
session.closePromptQueueDrain();
|
|
2441
|
+
heldInput.drop("aborted");
|
|
2442
|
+
messageQueue.discardAll("aborted");
|
|
2361
2443
|
logger.debug("[codex]: Final cleanup start");
|
|
2362
2444
|
logActiveHandles("cleanup-start");
|
|
2363
2445
|
if (reconnectionHandle) {
|