very-happy-cli 0.2.187 → 0.2.189
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-B2-ReWTo.cjs → AcpBackend-DRPJ2g9G.cjs} +3 -3
- package/dist/{AcpBackend-C4Emg-H3.mjs → AcpBackend-fj16v_cf.mjs} +3 -3
- package/dist/{AcpSessionManager-Nard_zFS.mjs → AcpSessionManager-BZPmUDL5.mjs} +4 -4
- package/dist/{AcpSessionManager-DR4-oZCz.cjs → AcpSessionManager-DM-KKg6v.cjs} +4 -4
- package/dist/{BasePermissionHandler-Bk9DmVZH.mjs → BasePermissionHandler-CVtH-snr.mjs} +1 -1
- package/dist/{BasePermissionHandler-CZ19WzsP.cjs → BasePermissionHandler-DjM16uJz.cjs} +1 -1
- package/dist/{acpSessionResume-Hto_b8MK.cjs → acpSessionResume-2BTMsB7_.cjs} +1 -1
- package/dist/{acpSessionResume-DPSfMe7r.mjs → acpSessionResume-Dxl1LRAT.mjs} +1 -1
- package/dist/{agentHome-4-odnrAk.mjs → agentHome-CHctmMzZ.mjs} +4 -4
- package/dist/{agentHome-Mveyfa24.cjs → agentHome-W17n1gnH.cjs} +4 -4
- package/dist/{api-cVvbFZVK.mjs → api-B0yN68XH.mjs} +10 -10
- package/dist/{api-DVEzYcoy.cjs → api-BDuuyys8.cjs} +10 -10
- package/dist/{apiMachine-Bd1C_JN6.cjs → apiMachine-iddD-F19.cjs} +14 -14
- package/dist/{apiMachine-M7qY1izH.mjs → apiMachine-mc9CsKuS.mjs} +14 -14
- package/dist/{attachmentContent-D8hViGiA.cjs → attachmentContent-Cc5b7TPr.cjs} +2 -2
- package/dist/{attachmentContent-NNF-Eo4O.mjs → attachmentContent-CcIdMfAx.mjs} +2 -2
- package/dist/{auth-BHw8be0X.cjs → auth-B7tVmyfX.cjs} +8 -8
- package/dist/{auth-BCHL8Fx5.mjs → auth-CyrVvWHF.mjs} +5 -5
- package/dist/{auth-CKNEKwEV.mjs → auth-DNAgkUkB.mjs} +8 -8
- package/dist/{auth-b_1h0677.cjs → auth-DQKSpaEf.cjs} +5 -5
- package/dist/{auto-D716QYa3.mjs → auto-BklCipw1.mjs} +18 -17
- package/dist/{auto-Da4rCLal.cjs → auto-CetlumDo.cjs} +18 -17
- package/dist/{bootstrap-j2RuoHVy.cjs → bootstrap-CDY-Vz8q.cjs} +2 -2
- package/dist/{bootstrap-CndcegDb.mjs → bootstrap-DfXwkUQb.mjs} +2 -2
- package/dist/{browser-DIYTnD_T.cjs → browser-D1yzC0Tu.cjs} +1 -1
- package/dist/{browser-CLsM513o.mjs → browser-vb0k1zfI.mjs} +1 -1
- package/dist/{claudeLocal-C_uUbEO_.cjs → claudeLocal-2dJIiTIq.cjs} +5 -5
- package/dist/{claudeLocal-3HbTx7K-.mjs → claudeLocal-Bid_rC_v.mjs} +5 -5
- package/dist/{claudeLocalLauncher-DXh2chq3.mjs → claudeLocalLauncher-5pzpETxd.mjs} +10 -10
- package/dist/{claudeLocalLauncher-BxWouVYk.cjs → claudeLocalLauncher-Jm5oQX5Z.cjs} +10 -10
- package/dist/{claudeSessionFork-CsU96yXX.cjs → claudeSessionFork-DsbcuDEJ.cjs} +1 -1
- package/dist/{claudeSessionFork-B4olbwfj.mjs → claudeSessionFork-DzecSBO4.mjs} +1 -1
- package/dist/{client-C8w9aQYe.mjs → client-B161HwAk.mjs} +2 -2
- package/dist/{client-CCy72Phz.cjs → client-BNmFaRXZ.cjs} +4 -4
- package/dist/{client-D8p1YjVt.mjs → client-C9Ecbtko.mjs} +4 -4
- package/dist/{client-Zqg7DXHl.mjs → client-CvjjadIE.mjs} +2 -2
- package/dist/{client-CWSfPlGD.cjs → client-D0aYWt53.cjs} +2 -2
- package/dist/{client-q1aNOKgy.cjs → client-DIfxYk7B.cjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +17 -16
- package/dist/codex/happyMcpStdioBridge.mjs +17 -16
- package/dist/{codexAppServerClient-Csc-XsRV.mjs → codexAppServerClient-BlVmpjR-.mjs} +63 -5
- package/dist/{codexAppServerClient-g8npaIU9.cjs → codexAppServerClient-CO9f4Jr8.cjs} +63 -5
- package/dist/{codexCommand-BV8pTAtv.cjs → codexCommand-BfoRP6E9.cjs} +189 -68
- package/dist/{codexCommand-BS-foS_R.mjs → codexCommand-CAMR4g5o.mjs} +188 -67
- package/dist/{codexTermination-lOO15mt2.mjs → codexTermination-BvGlN02_.mjs} +1 -1
- package/dist/{codexTermination-B5WgZAWO.cjs → codexTermination-IrLZQzKC.cjs} +1 -1
- package/dist/{config-BOnZRJIG.cjs → config-BGFqQGvh.cjs} +3 -3
- package/dist/{config-Ba5ufl-D.mjs → config-CtMgGPvf.mjs} +3 -3
- package/dist/{configuration-8EAa2X9P.mjs → configuration-1FabKklB.mjs} +1 -1
- package/dist/{configuration-CAfdO4IC.cjs → configuration-C0ctLGW2.cjs} +1 -1
- package/dist/{connect-BHWHNe54.mjs → connect-0lSugpjf.mjs} +13 -13
- package/dist/{connect-2hWuvxRM.cjs → connect-DSw-2f52.cjs} +13 -13
- package/dist/{context-B-jybQhf.mjs → context-BgxbXWKS.mjs} +1 -1
- package/dist/{context-BtCz06PX.cjs → context-D-hEk5pC.cjs} +1 -1
- package/dist/{controlClient-O-vf2MkJ.mjs → controlClient-DwNnNAUx.mjs} +4 -4
- package/dist/{controlClient-mH9AxBwT.cjs → controlClient-F7hAEEy2.cjs} +3 -3
- package/dist/{createSessionMetadata-HlzlfP0U.mjs → createSessionMetadata-CG6Klinp.mjs} +2 -2
- package/dist/{createSessionMetadata-Bcn7b8QB.cjs → createSessionMetadata-DezS33OM.cjs} +2 -2
- package/dist/{defaultPermissionMode-BN3PdltF.cjs → defaultPermissionMode-5EvgRq38.cjs} +2 -2
- package/dist/{defaultPermissionMode-BPDeX4S8.mjs → defaultPermissionMode-e2bIIJG4.mjs} +2 -2
- package/dist/{deterministicJson-CruOxFA6.mjs → deterministicJson-BMwgK21e.mjs} +13 -13
- package/dist/{deterministicJson-D9pZQhU9.cjs → deterministicJson-D0LU_XbO.cjs} +13 -13
- package/dist/{doctor-BNhLBBTK.mjs → doctor-D16hySse.mjs} +7 -7
- package/dist/{doctor-lHD1YZH6.cjs → doctor-wVNvRarN.cjs} +7 -7
- package/dist/{downloadTarget-ByTxs_N5.mjs → downloadTarget-C6tqaXGm.mjs} +6 -6
- package/dist/{downloadTarget-BhkQxTa8.cjs → downloadTarget-aNcCxVRL.cjs} +6 -6
- package/dist/{ensureDaemonRunning-BiCK6RiS.cjs → ensureDaemonRunning-CIghxgDR.cjs} +5 -5
- package/dist/{ensureDaemonRunning-Cv0AMaHK.mjs → ensureDaemonRunning-DZq8bvsp.mjs} +5 -5
- package/dist/{handleResumeCommand-Cy_KW0LN.mjs → handleResumeCommand-BNnD7EuD.mjs} +5 -5
- package/dist/{handleResumeCommand-WB4VDeKk.cjs → handleResumeCommand-CMUTygsm.cjs} +5 -5
- package/dist/{index-BpWESchl.cjs → index-4TpmBb2Q.cjs} +3 -3
- package/dist/{index-Vtcax4oD.cjs → index-B81qV_F_.cjs} +4 -4
- package/dist/{index-CVMbboXv.mjs → index-BCQr-5Ei.mjs} +4 -4
- package/dist/{index-BumVulwx.cjs → index-BOe6dKnL.cjs} +215 -18
- package/dist/{index-CdOz1uDl.mjs → index-BuiG8hmg.mjs} +94 -45
- package/dist/{index-BpSpw6jG.mjs → index-CKd20r1W.mjs} +3 -3
- package/dist/{index-B44ft-m4.cjs → index-CnzsOD19.cjs} +93 -44
- package/dist/{index-Bcp-PEGc.cjs → index-De02DNu5.cjs} +4 -4
- package/dist/{index-lWXWV0H2.mjs → index-Df0bc_et.mjs} +4 -4
- package/dist/{index-B9f1vKcC.mjs → index-WKyN-bNy.mjs} +212 -17
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-mK93DJ6L.mjs → install-23ehAdTD.mjs} +3 -3
- package/dist/{install-DdRVv9IS.cjs → install-DNbIEJUk.cjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +14 -0
- package/dist/lib.d.mts +14 -0
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-XyjQaZtU.cjs → lidState-B4dHJCeS.cjs} +1 -1
- package/dist/{lidState-LtdUCXi-.mjs → lidState-q5Its2Hm.mjs} +1 -1
- package/dist/{localHappyAgentAuth-C9Aj_wGD.cjs → localHappyAgentAuth-CG2nPD_H.cjs} +1 -1
- package/dist/{localHappyAgentAuth-DqFE0Adr.mjs → localHappyAgentAuth-C_G5u5lY.mjs} +1 -1
- package/dist/{logger-BILSzq2s.cjs → logger-BP1SW7Cs.cjs} +2 -2
- package/dist/{logger-SAU4uSs4.mjs → logger-DOKH3Zbh.mjs} +2 -2
- package/dist/{machineMetadata-C5TgUTpD.cjs → machineMetadata-BKX3ov9g.cjs} +3 -3
- package/dist/{machineMetadata-ZVnihOuL.mjs → machineMetadata-D-5qeIqd.mjs} +3 -3
- package/dist/{main-BjOHtX8u.mjs → main-DODz8DQE.mjs} +46 -46
- package/dist/{main-CVfx_-l7.cjs → main-ndpVIaSG.cjs} +46 -46
- package/dist/{mcp-CWVr7KbQ.mjs → mcp-BBwbSODp.mjs} +16 -15
- package/dist/{mcp-By9XK193.cjs → mcp-Bc4U4exu.cjs} +16 -15
- package/dist/{mirrorProtocol-C0wyaesn.cjs → mirrorProtocol-CiA3hO2y.cjs} +3 -3
- package/dist/{mirrorProtocol-BI6XbokT.mjs → mirrorProtocol-D2vTWteS.mjs} +3 -3
- package/dist/{package-Bbfq2KR7.cjs → package-CYDdLA6R.cjs} +7 -7
- package/dist/{package-BMBwnCn3.mjs → package-DTcaIhjW.mjs} +7 -7
- package/dist/{panels-rQmysHlY.cjs → panels-C2xZ8rqU.cjs} +5 -5
- package/dist/{panels-CbIUwV6q.mjs → panels-DCaLxlSL.mjs} +5 -5
- package/dist/{peerTools-CZfiq_Dx.cjs → peerTools-B4315xjX.cjs} +5 -5
- package/dist/{peerTools-CyruQrOo.mjs → peerTools-BtrUnSwz.mjs} +5 -5
- package/dist/{persistence-C7T3HYjq.mjs → persistence-0INrP3aB.mjs} +2 -2
- package/dist/{persistence-DPeSC0SK.cjs → persistence-CrzC7yr_.cjs} +2 -2
- package/dist/{piRunnerArgs-DAq8vIpP.cjs → piRunnerArgs-BtzW_kfh.cjs} +1 -1
- package/dist/{piRunnerArgs-CsWompo8.mjs → piRunnerArgs-DRuxMlX1.mjs} +1 -1
- package/dist/{piRuntime-Dxd8Gfun.mjs → piRuntime-BMAFpIBV.mjs} +1 -1
- package/dist/{piRuntime-CFqlQFoz.cjs → piRuntime-DEbPE_kW.cjs} +1 -1
- package/dist/{piTerminal-BssuKDtJ.mjs → piTerminal-DQXV8_we.mjs} +18 -17
- package/dist/{piTerminal-DHG3Kzve.cjs → piTerminal-MtxDtBE2.cjs} +18 -17
- package/dist/{pushNotifications-CsSyhnHu.cjs → pushNotifications-CalIS9sq.cjs} +3 -3
- package/dist/{pushNotifications-Bi72c41d.mjs → pushNotifications-Cq1s8YVK.mjs} +3 -3
- package/dist/{query-BQOwsKS1.mjs → query-BYiPBHPC.mjs} +1 -1
- package/dist/{query-Cuef299f.cjs → query-CE2XDhhw.cjs} +1 -1
- package/dist/{specialCommands-35KxDNE8.cjs → rateLimitReporter-BKmoOZQi.cjs} +3 -55
- package/dist/{specialCommands-CTtmGCCf.mjs → rateLimitReporter-DR5LXuiQ.mjs} +4 -55
- package/dist/{rateLimitWindows-B6IAWYN5.mjs → rateLimitWindows-5vIuNjko.mjs} +1 -1
- package/dist/{rateLimitWindows-bfwC81Z-.cjs → rateLimitWindows-Cs56YJCH.cjs} +1 -1
- package/dist/{registerCommonHandlers-qzb6TQqo.mjs → registerCommonHandlers-DWkTysjD.mjs} +2 -2
- package/dist/{registerCommonHandlers-CQC04iF3.cjs → registerCommonHandlers-DZPozYxc.cjs} +2 -2
- package/dist/{registerKillSessionHandler-DMPrrNKX.mjs → registerKillSessionHandler-CSCTRIbI.mjs} +34 -6
- package/dist/{registerKillSessionHandler-BraKB5Ks.cjs → registerKillSessionHandler-DhCjrs44.cjs} +34 -6
- package/dist/{remoteSessionClient-DffolBcQ.cjs → remoteSessionClient-Dq8XTLQP.cjs} +5 -5
- package/dist/{remoteSessionClient-D3XhN_sd.mjs → remoteSessionClient-Vfj_5g2-.mjs} +5 -5
- package/dist/{reportProgressTool-irHR-XEW.mjs → reportProgressTool-B7zmX7NJ.mjs} +3 -3
- package/dist/{reportProgressTool-BieTXE_R.cjs → reportProgressTool-DznxPKES.cjs} +3 -3
- package/dist/{run-Ck_WA6Nj.cjs → run-Ca8BiNCp.cjs} +36 -35
- package/dist/{run-DCUaxe2S.mjs → run-DSfNcR62.mjs} +36 -35
- package/dist/{runClaude-BUGku2Qp.cjs → runClaude-ClQQcgoO.cjs} +22 -22
- package/dist/{runClaude-BryAvfNV.mjs → runClaude-hoepv-0X.mjs} +22 -22
- package/dist/{runClaudeDeps-BZkWM9_u.mjs → runClaudeDeps-D_v8t2SK.mjs} +88 -55
- package/dist/{runClaudeDeps-Dbk1VrOW.cjs → runClaudeDeps-ck5_GYlP.cjs} +85 -52
- package/dist/{runGemini-DT379gpi.mjs → runGemini-CTr2-cYG.mjs} +38 -33
- package/dist/{runGemini-B6AZ2bv0.cjs → runGemini-Cj0XsMiM.cjs} +38 -33
- package/dist/{runOpenClaw-eBUYlIVJ.cjs → runOpenClaw-BoN1e3lP.cjs} +23 -18
- package/dist/{runOpenClaw-Bpp9mkyO.mjs → runOpenClaw-CdDMntiV.mjs} +23 -18
- package/dist/{sandbox-Bv4H1P6u.cjs → sandbox-BY2h19gc.cjs} +4 -4
- package/dist/{sandbox-Z8TM9eUg.mjs → sandbox-DcaWB-Ou.mjs} +4 -4
- package/dist/selfCheck-BQ_H2Sns.mjs +86 -0
- package/dist/{selfCheck--1k2Ptf6.cjs → selfCheck-DFS_GUaQ.cjs} +37 -37
- package/dist/{send-BG4KYe6f.cjs → send-BMsUYU6g.cjs} +9 -8
- package/dist/{send-CKTovWuQ.mjs → send-UBTHHNvZ.mjs} +9 -8
- package/dist/{server-DLpXtoiZ.mjs → server-Dt3mCtfQ.mjs} +4 -4
- package/dist/{server-BTNwH-sA.cjs → server-YrHMHNz1.cjs} +6 -6
- package/dist/{sessionLock-Cf6RlgfF.cjs → sessionLock-DSqiP2lH.cjs} +3 -3
- package/dist/{sessionLock-DhzB5ZI9.mjs → sessionLock-tEFvFXLD.mjs} +3 -3
- package/dist/{sessionOps-R52JWMnX.cjs → sessionOps-BzeOKIEF.cjs} +27 -4
- package/dist/{sessionOps-CiFjBCMa.mjs → sessionOps-CljctDs5.mjs} +27 -4
- package/dist/{sessionProvider-f2tUhwBc.mjs → sessionProvider-BnUFSJXM.mjs} +5 -5
- package/dist/{sessionProvider-LATn-lZL.cjs → sessionProvider-ORgzmkXy.cjs} +5 -5
- package/dist/{sessionScanner-DRzZtGtu.cjs → sessionScanner-Cr6PJ3PT.cjs} +3 -3
- package/dist/{sessionScanner-lS1puA5H.mjs → sessionScanner-DZUlkdF6.mjs} +3 -3
- package/dist/{sessions-D01nnjOE.mjs → sessions-15cag-su.mjs} +11 -10
- package/dist/{sessions-DGd8Fin6.cjs → sessions-aIo_HjmY.cjs} +11 -10
- package/dist/{setupOfflineReconnection-UApZjcU5.mjs → setupOfflineReconnection-B7I8R2Ex.mjs} +2 -2
- package/dist/{setupOfflineReconnection-Ds7ywGwR.cjs → setupOfflineReconnection-tV0Q1dgR.cjs} +2 -2
- package/dist/{spawn-ct8aSMA8.mjs → spawn-ByrQgruJ.mjs} +70 -28
- package/dist/{spawn-CT3g4p8A.cjs → spawn-VG-HjJiR.cjs} +70 -27
- package/dist/{spawnAgents-f2q31uUV.mjs → spawnAgents-Bh1RPShN.mjs} +24 -11
- package/dist/{spawnAgents-DsJSyLDl.cjs → spawnAgents-C1-4m7aN.cjs} +24 -10
- package/dist/{spawnHappyCLI-Dp05fHcp.mjs → spawnHappyCLI-CEsXwz5V.mjs} +1 -1
- package/dist/{spawnHappyCLI-DedrWByd.cjs → spawnHappyCLI-CxiR2Qoy.cjs} +1 -1
- package/dist/specialCommands-J3JFOq0J.cjs +60 -0
- package/dist/specialCommands-MXUN0wfI.mjs +54 -0
- package/dist/{startFileWatcher-72w11DP_.cjs → startFileWatcher-C-XCZ5t2.cjs} +1 -1
- package/dist/{startFileWatcher-BLdxJdgu.mjs → startFileWatcher-DkEeeAtL.mjs} +1 -1
- package/dist/{startupSessionCreate-Cy4J4-Ep.cjs → startupSessionCreate-CYc8mra-.cjs} +1 -1
- package/dist/{startupSessionCreate-CJFR_Zom.mjs → startupSessionCreate-npXe2TdN.mjs} +1 -1
- package/dist/{streamRelay-B3FloUTT.mjs → streamRelay-CqBynIon.mjs} +1 -1
- package/dist/{streamRelay-Cn_uGG6m.cjs → streamRelay-D9a4cBEa.cjs} +1 -1
- package/dist/{sync-BWX1OVQi.mjs → sync-BvDMkKAN.mjs} +1 -1
- package/dist/{sync-lxDpbIh3.cjs → sync-CoChLEIg.cjs} +1 -1
- package/dist/{systemPrompt-BIilbjt_.mjs → systemPrompt-CgDaPigN.mjs} +2 -2
- package/dist/{systemPrompt-0DqWPGY6.cjs → systemPrompt-Dy_Rf-0Z.cjs} +2 -2
- package/dist/{teams-CvpB8Rdm.mjs → teams-BC4_e5hR.mjs} +7 -7
- package/dist/{teams-CImmJLlM.cjs → teams-DPvfLAk8.cjs} +7 -7
- package/dist/{template-DPsqlHJQ.cjs → template-17HATY_Y.cjs} +1 -1
- package/dist/{template-DuKZw-Sz.mjs → template-CEK8MEjo.mjs} +1 -1
- package/dist/{time-DjS5me2q.mjs → time-CUK37wiV.mjs} +1 -1
- package/dist/{time-BbQJi3Eh.cjs → time-XwEZxKGc.cjs} +1 -1
- package/dist/{titleGenerator-CfJme6ep.cjs → titleGenerator-DVX0NZUn.cjs} +2 -2
- package/dist/{titleGenerator-CGdBp5lQ.mjs → titleGenerator-DWRVdqMU.mjs} +1 -1
- package/dist/{todo-BxfUKwTM.mjs → todo-BNMGXneA.mjs} +6 -6
- package/dist/{todo-rN20m9lT.cjs → todo-CKGrSrRE.cjs} +6 -6
- package/dist/{tools-B_W7xJNh.mjs → tools-CCIEAVbB.mjs} +1 -1
- package/dist/{tools-kGtSjG8h.cjs → tools-CjMafO_D.cjs} +1 -1
- package/dist/{uninstall-CBQsxEmD.cjs → uninstall-BdFbTXnL.cjs} +3 -3
- package/dist/{uninstall-DUjvgLlg.mjs → uninstall-CJvJ7gjr.mjs} +3 -3
- package/package.json +7 -7
- package/dist/selfCheck-DIGghfQz.mjs +0 -86
|
@@ -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-DOKH3Zbh.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-DTcaIhjW.mjs';
|
|
8
|
+
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-5vIuNjko.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;
|
|
@@ -47,6 +47,10 @@ function jsonRpcErrorCodeOf(error) {
|
|
|
47
47
|
const code = error?.jsonRpcCode;
|
|
48
48
|
return typeof code === "number" ? code : null;
|
|
49
49
|
}
|
|
50
|
+
function threadModelOf(result) {
|
|
51
|
+
const model = result?.model ?? result?.thread?.model;
|
|
52
|
+
return typeof model === "string" && model.trim() ? model.trim() : null;
|
|
53
|
+
}
|
|
50
54
|
function isAppServerAvailable() {
|
|
51
55
|
try {
|
|
52
56
|
const version = execSync("codex --version", { encoding: "utf8", windowsHide: true }).trim();
|
|
@@ -127,6 +131,12 @@ class CodexAppServerClient {
|
|
|
127
131
|
// Session state
|
|
128
132
|
_threadId = null;
|
|
129
133
|
_turnId = null;
|
|
134
|
+
/**
|
|
135
|
+
* B-844d: the model the thread really runs. Codex keeps a thread's model
|
|
136
|
+
* (thread/start, thread/resume, a turn/start that named one) for every
|
|
137
|
+
* later turn that omits it, and reports it on start/resume/fork.
|
|
138
|
+
*/
|
|
139
|
+
_threadModel = null;
|
|
130
140
|
threadDefaults = null;
|
|
131
141
|
// Turn completion tracking for the currently active sendTurnAndWait call.
|
|
132
142
|
pendingTurnCompletion = null;
|
|
@@ -140,6 +150,8 @@ class CodexAppServerClient {
|
|
|
140
150
|
completedTurnIds = /* @__PURE__ */ new Set();
|
|
141
151
|
/** B-625: turns whose failure has already been forwarded, so a second failed frame is not. */
|
|
142
152
|
failedTurnIds = /* @__PURE__ */ new Set();
|
|
153
|
+
/** The turn the last pending completion was resolved for (runTurnAndWait reads its verdict). */
|
|
154
|
+
lastResolvedTurnId = null;
|
|
143
155
|
// B-625: the app-server speaks for every thread it hosts — the session's own and the
|
|
144
156
|
// children `spawn_agent` opens — so a lifecycle frame (turn/started, turn/completed,
|
|
145
157
|
// thread/status/changed, error, thread/closed) is the session's only when its `threadId`
|
|
@@ -190,6 +202,10 @@ class CodexAppServerClient {
|
|
|
190
202
|
get turnId() {
|
|
191
203
|
return this._turnId;
|
|
192
204
|
}
|
|
205
|
+
/** B-844d: the model the current thread runs for turns that name none (null = unknown). */
|
|
206
|
+
get threadModel() {
|
|
207
|
+
return this._threadModel;
|
|
208
|
+
}
|
|
193
209
|
setEventHandler(handler) {
|
|
194
210
|
this.eventHandler = handler;
|
|
195
211
|
}
|
|
@@ -640,6 +656,7 @@ ${text}`.slice(-400);
|
|
|
640
656
|
this.clearThreadStopGrace();
|
|
641
657
|
if (!opts?.preserveThreadState) {
|
|
642
658
|
this._threadId = null;
|
|
659
|
+
this._threadModel = null;
|
|
643
660
|
this.threadDefaults = null;
|
|
644
661
|
}
|
|
645
662
|
for (const [id, req] of this.pending) {
|
|
@@ -742,6 +759,7 @@ ${text}`.slice(-400);
|
|
|
742
759
|
const result = await this.request("thread/start", params);
|
|
743
760
|
this._threadId = result.thread.id;
|
|
744
761
|
this._turnId = null;
|
|
762
|
+
this._threadModel = threadModelOf(result);
|
|
745
763
|
this.rememberThreadDefaults(opts);
|
|
746
764
|
logger.debug("[CodexAppServer] Thread started:", this._threadId);
|
|
747
765
|
return { threadId: result.thread.id, model: result.model };
|
|
@@ -768,6 +786,7 @@ ${text}`.slice(-400);
|
|
|
768
786
|
const result = await this.request("thread/resume", params);
|
|
769
787
|
this._threadId = result.thread.id;
|
|
770
788
|
this._turnId = null;
|
|
789
|
+
this._threadModel = threadModelOf(result);
|
|
771
790
|
this.rememberThreadDefaults({
|
|
772
791
|
model: opts?.model ?? defaults.model,
|
|
773
792
|
cwd: opts?.cwd ?? defaults.cwd,
|
|
@@ -797,6 +816,7 @@ ${text}`.slice(-400);
|
|
|
797
816
|
const result = await this.request("thread/fork", params);
|
|
798
817
|
this._threadId = result.thread.id;
|
|
799
818
|
this._turnId = null;
|
|
819
|
+
this._threadModel = threadModelOf(result);
|
|
800
820
|
this.rememberThreadDefaults({
|
|
801
821
|
model: opts.model ?? defaults.model,
|
|
802
822
|
cwd: opts.cwd ?? defaults.cwd,
|
|
@@ -844,6 +864,7 @@ ${text}`.slice(-400);
|
|
|
844
864
|
} catch (error) {
|
|
845
865
|
logger.warn("[CodexAppServer] Failed to resume thread after reconnect", error);
|
|
846
866
|
this._threadId = null;
|
|
867
|
+
this._threadModel = null;
|
|
847
868
|
this.threadDefaults = null;
|
|
848
869
|
return false;
|
|
849
870
|
}
|
|
@@ -858,6 +879,7 @@ ${text}`.slice(-400);
|
|
|
858
879
|
}
|
|
859
880
|
resolvePendingTurn(aborted) {
|
|
860
881
|
if (!this.pendingTurnCompletion) return;
|
|
882
|
+
this.lastResolvedTurnId = this.pendingTurnCompletion.turnId;
|
|
861
883
|
this.clearTurnWatchdog();
|
|
862
884
|
this.clearThreadStopGrace();
|
|
863
885
|
this.pendingTurnCompletion.resolve(aborted);
|
|
@@ -992,6 +1014,7 @@ ${text}`.slice(-400);
|
|
|
992
1014
|
);
|
|
993
1015
|
return;
|
|
994
1016
|
}
|
|
1017
|
+
if (!pending.turnId && turnId) pending.turnId = turnId;
|
|
995
1018
|
this.resolvePendingTurn(aborted);
|
|
996
1019
|
}
|
|
997
1020
|
async waitForTurnCompletion(timeoutMs) {
|
|
@@ -1074,6 +1097,10 @@ ${text}`.slice(-400);
|
|
|
1074
1097
|
}
|
|
1075
1098
|
}
|
|
1076
1099
|
const result = await this.request("turn/start", params);
|
|
1100
|
+
if (opts?.model) {
|
|
1101
|
+
this._threadModel = opts.model;
|
|
1102
|
+
if (this.threadDefaults) this.threadDefaults.model = opts.model;
|
|
1103
|
+
}
|
|
1077
1104
|
const turnId = result?.turn?.id;
|
|
1078
1105
|
if (typeof turnId === "string" && turnId.length > 0) {
|
|
1079
1106
|
this._turnId = turnId;
|
|
@@ -1091,6 +1118,24 @@ ${text}`.slice(-400);
|
|
|
1091
1118
|
* Returns { aborted: true } if the turn was aborted (user cancel, permission reject, etc.).
|
|
1092
1119
|
*/
|
|
1093
1120
|
async sendTurnAndWait(prompt, opts) {
|
|
1121
|
+
const { aborted } = await this.runTurnAndWait(() => this.sendTurn(prompt, opts), opts);
|
|
1122
|
+
return { aborted };
|
|
1123
|
+
}
|
|
1124
|
+
/**
|
|
1125
|
+
* `/compact`: Codex compacts the thread in a turn of its own
|
|
1126
|
+
* (`thread/compact/start` answers `{}`, then `turn/started` →
|
|
1127
|
+
* `contextCompaction` item → `turn/completed`, probed on codex-cli 0.154).
|
|
1128
|
+
* Waits for that turn like any other; `failed` is the turn's own verdict.
|
|
1129
|
+
*/
|
|
1130
|
+
async compactThreadAndWait(opts) {
|
|
1131
|
+
return this.runTurnAndWait(async () => {
|
|
1132
|
+
if (!this._threadId) {
|
|
1133
|
+
throw new Error("No active thread. Call startThread first.");
|
|
1134
|
+
}
|
|
1135
|
+
await this.request("thread/compact/start", { threadId: this._threadId });
|
|
1136
|
+
}, opts);
|
|
1137
|
+
}
|
|
1138
|
+
async runTurnAndWait(start, opts) {
|
|
1094
1139
|
if (this.pendingInterrupt) {
|
|
1095
1140
|
await this.pendingInterrupt;
|
|
1096
1141
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -1108,7 +1153,7 @@ ${text}`.slice(-400);
|
|
|
1108
1153
|
this.armTurnWatchdog(timeoutMs);
|
|
1109
1154
|
});
|
|
1110
1155
|
try {
|
|
1111
|
-
await
|
|
1156
|
+
await start();
|
|
1112
1157
|
} catch (err) {
|
|
1113
1158
|
this.clearTurnWatchdog();
|
|
1114
1159
|
this.pendingTurnCompletion = null;
|
|
@@ -1117,7 +1162,8 @@ ${text}`.slice(-400);
|
|
|
1117
1162
|
}
|
|
1118
1163
|
const aborted = await completion;
|
|
1119
1164
|
this.clearTurnWatchdog();
|
|
1120
|
-
|
|
1165
|
+
const turnId = this.lastResolvedTurnId;
|
|
1166
|
+
return { aborted, failed: turnId !== null && this.failedTurnIds.has(turnId) };
|
|
1121
1167
|
}
|
|
1122
1168
|
armTurnWatchdog(timeoutMs) {
|
|
1123
1169
|
this.clearTurnWatchdog();
|
|
@@ -1185,6 +1231,7 @@ ${text}`.slice(-400);
|
|
|
1185
1231
|
this.resolvePendingTurn(true);
|
|
1186
1232
|
this._threadId = null;
|
|
1187
1233
|
this._turnId = null;
|
|
1234
|
+
this._threadModel = null;
|
|
1188
1235
|
this.threadDefaults = null;
|
|
1189
1236
|
this.completedTurnIds.clear();
|
|
1190
1237
|
this.failedTurnIds.clear();
|
|
@@ -1208,6 +1255,17 @@ ${text}`.slice(-400);
|
|
|
1208
1255
|
} while (cursor);
|
|
1209
1256
|
return models;
|
|
1210
1257
|
}
|
|
1258
|
+
/**
|
|
1259
|
+
* B-844: the model Codex's effective configuration pins (config.toml,
|
|
1260
|
+
* profile, CLI overrides) via `config/read`; null = nothing pinned.
|
|
1261
|
+
* Throws when this Codex has no `config/read` — the caller then reports
|
|
1262
|
+
* nothing (unknown) and the web sends no model.
|
|
1263
|
+
*/
|
|
1264
|
+
async readConfiguredModel(cwd) {
|
|
1265
|
+
const response = await this.request("config/read", { cwd }, 1e4);
|
|
1266
|
+
const model = response?.config?.model;
|
|
1267
|
+
return typeof model === "string" && model.trim() ? model.trim() : null;
|
|
1268
|
+
}
|
|
1211
1269
|
request(method, params, timeoutMs) {
|
|
1212
1270
|
const timeout = timeoutMs ?? CodexAppServerClient.REQUEST_TIMEOUT_MS;
|
|
1213
1271
|
return new Promise((resolve, reject) => {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
var node_child_process = require('node:child_process');
|
|
4
4
|
var spawn = require('cross-spawn');
|
|
5
5
|
var node_readline = require('node:readline');
|
|
6
|
-
var logger = require('./logger-
|
|
6
|
+
var logger = require('./logger-BP1SW7Cs.cjs');
|
|
7
7
|
var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
8
8
|
var manager = require('./manager-HrEj442o.cjs');
|
|
9
|
-
var _package = require('./package-
|
|
10
|
-
var rateLimitWindows = require('./rateLimitWindows-
|
|
9
|
+
var _package = require('./package-CYDdLA6R.cjs');
|
|
10
|
+
var rateLimitWindows = require('./rateLimitWindows-Cs56YJCH.cjs');
|
|
11
11
|
var processTree = require('./processTree-CMHWlVse.cjs');
|
|
12
12
|
|
|
13
13
|
const CODEX_HELPER_LABEL_MAX_CHARS = 80;
|
|
@@ -49,6 +49,10 @@ function jsonRpcErrorCodeOf(error) {
|
|
|
49
49
|
const code = error?.jsonRpcCode;
|
|
50
50
|
return typeof code === "number" ? code : null;
|
|
51
51
|
}
|
|
52
|
+
function threadModelOf(result) {
|
|
53
|
+
const model = result?.model ?? result?.thread?.model;
|
|
54
|
+
return typeof model === "string" && model.trim() ? model.trim() : null;
|
|
55
|
+
}
|
|
52
56
|
function isAppServerAvailable() {
|
|
53
57
|
try {
|
|
54
58
|
const version = node_child_process.execSync("codex --version", { encoding: "utf8", windowsHide: true }).trim();
|
|
@@ -129,6 +133,12 @@ class CodexAppServerClient {
|
|
|
129
133
|
// Session state
|
|
130
134
|
_threadId = null;
|
|
131
135
|
_turnId = null;
|
|
136
|
+
/**
|
|
137
|
+
* B-844d: the model the thread really runs. Codex keeps a thread's model
|
|
138
|
+
* (thread/start, thread/resume, a turn/start that named one) for every
|
|
139
|
+
* later turn that omits it, and reports it on start/resume/fork.
|
|
140
|
+
*/
|
|
141
|
+
_threadModel = null;
|
|
132
142
|
threadDefaults = null;
|
|
133
143
|
// Turn completion tracking for the currently active sendTurnAndWait call.
|
|
134
144
|
pendingTurnCompletion = null;
|
|
@@ -142,6 +152,8 @@ class CodexAppServerClient {
|
|
|
142
152
|
completedTurnIds = /* @__PURE__ */ new Set();
|
|
143
153
|
/** B-625: turns whose failure has already been forwarded, so a second failed frame is not. */
|
|
144
154
|
failedTurnIds = /* @__PURE__ */ new Set();
|
|
155
|
+
/** The turn the last pending completion was resolved for (runTurnAndWait reads its verdict). */
|
|
156
|
+
lastResolvedTurnId = null;
|
|
145
157
|
// B-625: the app-server speaks for every thread it hosts — the session's own and the
|
|
146
158
|
// children `spawn_agent` opens — so a lifecycle frame (turn/started, turn/completed,
|
|
147
159
|
// thread/status/changed, error, thread/closed) is the session's only when its `threadId`
|
|
@@ -192,6 +204,10 @@ class CodexAppServerClient {
|
|
|
192
204
|
get turnId() {
|
|
193
205
|
return this._turnId;
|
|
194
206
|
}
|
|
207
|
+
/** B-844d: the model the current thread runs for turns that name none (null = unknown). */
|
|
208
|
+
get threadModel() {
|
|
209
|
+
return this._threadModel;
|
|
210
|
+
}
|
|
195
211
|
setEventHandler(handler) {
|
|
196
212
|
this.eventHandler = handler;
|
|
197
213
|
}
|
|
@@ -642,6 +658,7 @@ ${text}`.slice(-400);
|
|
|
642
658
|
this.clearThreadStopGrace();
|
|
643
659
|
if (!opts?.preserveThreadState) {
|
|
644
660
|
this._threadId = null;
|
|
661
|
+
this._threadModel = null;
|
|
645
662
|
this.threadDefaults = null;
|
|
646
663
|
}
|
|
647
664
|
for (const [id, req] of this.pending) {
|
|
@@ -744,6 +761,7 @@ ${text}`.slice(-400);
|
|
|
744
761
|
const result = await this.request("thread/start", params);
|
|
745
762
|
this._threadId = result.thread.id;
|
|
746
763
|
this._turnId = null;
|
|
764
|
+
this._threadModel = threadModelOf(result);
|
|
747
765
|
this.rememberThreadDefaults(opts);
|
|
748
766
|
logger.logger.debug("[CodexAppServer] Thread started:", this._threadId);
|
|
749
767
|
return { threadId: result.thread.id, model: result.model };
|
|
@@ -770,6 +788,7 @@ ${text}`.slice(-400);
|
|
|
770
788
|
const result = await this.request("thread/resume", params);
|
|
771
789
|
this._threadId = result.thread.id;
|
|
772
790
|
this._turnId = null;
|
|
791
|
+
this._threadModel = threadModelOf(result);
|
|
773
792
|
this.rememberThreadDefaults({
|
|
774
793
|
model: opts?.model ?? defaults.model,
|
|
775
794
|
cwd: opts?.cwd ?? defaults.cwd,
|
|
@@ -799,6 +818,7 @@ ${text}`.slice(-400);
|
|
|
799
818
|
const result = await this.request("thread/fork", params);
|
|
800
819
|
this._threadId = result.thread.id;
|
|
801
820
|
this._turnId = null;
|
|
821
|
+
this._threadModel = threadModelOf(result);
|
|
802
822
|
this.rememberThreadDefaults({
|
|
803
823
|
model: opts.model ?? defaults.model,
|
|
804
824
|
cwd: opts.cwd ?? defaults.cwd,
|
|
@@ -846,6 +866,7 @@ ${text}`.slice(-400);
|
|
|
846
866
|
} catch (error) {
|
|
847
867
|
logger.logger.warn("[CodexAppServer] Failed to resume thread after reconnect", error);
|
|
848
868
|
this._threadId = null;
|
|
869
|
+
this._threadModel = null;
|
|
849
870
|
this.threadDefaults = null;
|
|
850
871
|
return false;
|
|
851
872
|
}
|
|
@@ -860,6 +881,7 @@ ${text}`.slice(-400);
|
|
|
860
881
|
}
|
|
861
882
|
resolvePendingTurn(aborted) {
|
|
862
883
|
if (!this.pendingTurnCompletion) return;
|
|
884
|
+
this.lastResolvedTurnId = this.pendingTurnCompletion.turnId;
|
|
863
885
|
this.clearTurnWatchdog();
|
|
864
886
|
this.clearThreadStopGrace();
|
|
865
887
|
this.pendingTurnCompletion.resolve(aborted);
|
|
@@ -994,6 +1016,7 @@ ${text}`.slice(-400);
|
|
|
994
1016
|
);
|
|
995
1017
|
return;
|
|
996
1018
|
}
|
|
1019
|
+
if (!pending.turnId && turnId) pending.turnId = turnId;
|
|
997
1020
|
this.resolvePendingTurn(aborted);
|
|
998
1021
|
}
|
|
999
1022
|
async waitForTurnCompletion(timeoutMs) {
|
|
@@ -1076,6 +1099,10 @@ ${text}`.slice(-400);
|
|
|
1076
1099
|
}
|
|
1077
1100
|
}
|
|
1078
1101
|
const result = await this.request("turn/start", params);
|
|
1102
|
+
if (opts?.model) {
|
|
1103
|
+
this._threadModel = opts.model;
|
|
1104
|
+
if (this.threadDefaults) this.threadDefaults.model = opts.model;
|
|
1105
|
+
}
|
|
1079
1106
|
const turnId = result?.turn?.id;
|
|
1080
1107
|
if (typeof turnId === "string" && turnId.length > 0) {
|
|
1081
1108
|
this._turnId = turnId;
|
|
@@ -1093,6 +1120,24 @@ ${text}`.slice(-400);
|
|
|
1093
1120
|
* Returns { aborted: true } if the turn was aborted (user cancel, permission reject, etc.).
|
|
1094
1121
|
*/
|
|
1095
1122
|
async sendTurnAndWait(prompt, opts) {
|
|
1123
|
+
const { aborted } = await this.runTurnAndWait(() => this.sendTurn(prompt, opts), opts);
|
|
1124
|
+
return { aborted };
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* `/compact`: Codex compacts the thread in a turn of its own
|
|
1128
|
+
* (`thread/compact/start` answers `{}`, then `turn/started` →
|
|
1129
|
+
* `contextCompaction` item → `turn/completed`, probed on codex-cli 0.154).
|
|
1130
|
+
* Waits for that turn like any other; `failed` is the turn's own verdict.
|
|
1131
|
+
*/
|
|
1132
|
+
async compactThreadAndWait(opts) {
|
|
1133
|
+
return this.runTurnAndWait(async () => {
|
|
1134
|
+
if (!this._threadId) {
|
|
1135
|
+
throw new Error("No active thread. Call startThread first.");
|
|
1136
|
+
}
|
|
1137
|
+
await this.request("thread/compact/start", { threadId: this._threadId });
|
|
1138
|
+
}, opts);
|
|
1139
|
+
}
|
|
1140
|
+
async runTurnAndWait(start, opts) {
|
|
1096
1141
|
if (this.pendingInterrupt) {
|
|
1097
1142
|
await this.pendingInterrupt;
|
|
1098
1143
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
@@ -1110,7 +1155,7 @@ ${text}`.slice(-400);
|
|
|
1110
1155
|
this.armTurnWatchdog(timeoutMs);
|
|
1111
1156
|
});
|
|
1112
1157
|
try {
|
|
1113
|
-
await
|
|
1158
|
+
await start();
|
|
1114
1159
|
} catch (err) {
|
|
1115
1160
|
this.clearTurnWatchdog();
|
|
1116
1161
|
this.pendingTurnCompletion = null;
|
|
@@ -1119,7 +1164,8 @@ ${text}`.slice(-400);
|
|
|
1119
1164
|
}
|
|
1120
1165
|
const aborted = await completion;
|
|
1121
1166
|
this.clearTurnWatchdog();
|
|
1122
|
-
|
|
1167
|
+
const turnId = this.lastResolvedTurnId;
|
|
1168
|
+
return { aborted, failed: turnId !== null && this.failedTurnIds.has(turnId) };
|
|
1123
1169
|
}
|
|
1124
1170
|
armTurnWatchdog(timeoutMs) {
|
|
1125
1171
|
this.clearTurnWatchdog();
|
|
@@ -1187,6 +1233,7 @@ ${text}`.slice(-400);
|
|
|
1187
1233
|
this.resolvePendingTurn(true);
|
|
1188
1234
|
this._threadId = null;
|
|
1189
1235
|
this._turnId = null;
|
|
1236
|
+
this._threadModel = null;
|
|
1190
1237
|
this.threadDefaults = null;
|
|
1191
1238
|
this.completedTurnIds.clear();
|
|
1192
1239
|
this.failedTurnIds.clear();
|
|
@@ -1210,6 +1257,17 @@ ${text}`.slice(-400);
|
|
|
1210
1257
|
} while (cursor);
|
|
1211
1258
|
return models;
|
|
1212
1259
|
}
|
|
1260
|
+
/**
|
|
1261
|
+
* B-844: the model Codex's effective configuration pins (config.toml,
|
|
1262
|
+
* profile, CLI overrides) via `config/read`; null = nothing pinned.
|
|
1263
|
+
* Throws when this Codex has no `config/read` — the caller then reports
|
|
1264
|
+
* nothing (unknown) and the web sends no model.
|
|
1265
|
+
*/
|
|
1266
|
+
async readConfiguredModel(cwd) {
|
|
1267
|
+
const response = await this.request("config/read", { cwd }, 1e4);
|
|
1268
|
+
const model = response?.config?.model;
|
|
1269
|
+
return typeof model === "string" && model.trim() ? model.trim() : null;
|
|
1270
|
+
}
|
|
1213
1271
|
request(method, params, timeoutMs) {
|
|
1214
1272
|
const timeout = timeoutMs ?? CodexAppServerClient.REQUEST_TIMEOUT_MS;
|
|
1215
1273
|
return new Promise((resolve, reject) => {
|