very-happy-cli 0.2.174 → 0.2.175
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-CS8TSaaH.mjs → AcpBackend-BZrLVcHb.mjs} +3 -3
- package/dist/{AcpBackend-MMfGUkmp.cjs → AcpBackend-Sb6N_HcB.cjs} +3 -3
- package/dist/{BasePermissionHandler-CJQPjMEa.cjs → BasePermissionHandler-BbLYwd13.cjs} +1 -1
- package/dist/{BasePermissionHandler-BiWdGyL1.mjs → BasePermissionHandler-DriZLITp.mjs} +1 -1
- package/dist/{BaseReasoningProcessor-2sLuoRYw.mjs → BaseReasoningProcessor-DnykPlPo.mjs} +1 -1
- package/dist/{BaseReasoningProcessor-BY9a3RTU.cjs → BaseReasoningProcessor-_S1PbSvH.cjs} +1 -1
- package/dist/{agentHome-BeAq0X3o.cjs → agentHome-BoYfpemd.cjs} +4 -4
- package/dist/{agentHome-CK6SbAVu.mjs → agentHome-BtuRubHG.mjs} +4 -4
- package/dist/{api-rOLB1-sV.mjs → api-D08IEaWa.mjs} +8 -8
- package/dist/{api-Cy_Mbe8W.cjs → api-KZmVqSKO.cjs} +8 -8
- package/dist/{apiMachine-VBkOChth.mjs → apiMachine-Cx9Zn-78.mjs} +13 -13
- package/dist/{apiMachine-A9n14NN1.cjs → apiMachine-Dct2GDAq.cjs} +13 -13
- package/dist/{attachmentContent-ULnsMsIL.cjs → attachmentContent-4L9dO8E3.cjs} +1 -1
- package/dist/{attachmentContent-CSGb8uDJ.mjs → attachmentContent-PrNJg8gG.mjs} +1 -1
- package/dist/{auth-BD2z4MCH.cjs → auth-BGmM3Vlm.cjs} +5 -5
- package/dist/{auth--YSQ1-dG.cjs → auth-BI0CsMcy.cjs} +8 -8
- package/dist/{auth-CiZfkTkd.mjs → auth-D1qHU-i_.mjs} +5 -5
- package/dist/{auth-EnJQu_vf.mjs → auth-PY_HGlzz.mjs} +8 -8
- package/dist/{auto-D_hKBFAY.mjs → auto-COMphIfD.mjs} +13 -13
- package/dist/{auto-CobMGmFM.cjs → auto-DM4_FeKb.cjs} +13 -13
- package/dist/{bootstrap-D1RRCJdQ.mjs → bootstrap-CWjpC5-J.mjs} +2 -2
- package/dist/{bootstrap-BYrt5zUv.cjs → bootstrap-DTJ6-vYT.cjs} +2 -2
- package/dist/{browser-i45hmvWw.cjs → browser-DmgVoopB.cjs} +1 -1
- package/dist/{browser-IVfX6PQT.mjs → browser-xuW4fiHo.mjs} +1 -1
- package/dist/{claudeLocal-DnPoeXP2.mjs → claudeLocal-B0P-wVJJ.mjs} +4 -4
- package/dist/{claudeLocal-Cg8Qn4tF.cjs → claudeLocal-CtZVz3ee.cjs} +4 -4
- package/dist/{claudeLocalLauncher-BAavVhU8.mjs → claudeLocalLauncher-D4vmjI3c.mjs} +9 -9
- package/dist/{claudeLocalLauncher-CFlsscqX.cjs → claudeLocalLauncher-Dnv4CH8r.cjs} +9 -9
- package/dist/{claudeSessionFork-bp8LeRZ9.mjs → claudeSessionFork-CxjOBoBh.mjs} +1 -1
- package/dist/{claudeSessionFork-DmwPXMmz.cjs → claudeSessionFork-DQk5-dzR.cjs} +1 -1
- package/dist/{client-QtWC3yii.cjs → client-BHZVyQwi.cjs} +3 -3
- package/dist/{client-B6H6ZROd.cjs → client-BhLhjj_x.cjs} +2 -2
- package/dist/{client-Bi1DOVy9.mjs → client-C4ddTzrD.mjs} +2 -2
- package/dist/{client-DbqP92Fy.mjs → client-eQjOvC55.mjs} +3 -3
- package/dist/codex/happyMcpStdioBridge.cjs +14 -14
- package/dist/codex/happyMcpStdioBridge.mjs +14 -14
- package/dist/{codexAppServerClient-pnCpJlD8.mjs → codexAppServerClient-CppPl_R6.mjs} +150 -23
- package/dist/{codexAppServerClient-BWB1267F.cjs → codexAppServerClient-D-9z-lWP.cjs} +150 -23
- package/dist/{codexCommand-u4m_X8VA.cjs → codexCommand-AgVJYnFU.cjs} +44 -39
- package/dist/{codexCommand-BmtdCu-D.mjs → codexCommand-BdrBNbZu.mjs} +44 -39
- package/dist/{config-Czc1tQDn.mjs → config-Cr3VUzbE.mjs} +3 -3
- package/dist/{config-BaJCpLzN.cjs → config-D89sE3wK.cjs} +3 -3
- package/dist/{configuration-zOfO2qdB.mjs → configuration-BNGPXg07.mjs} +1 -1
- package/dist/{configuration-Btwt68O2.cjs → configuration-UV4EE5ui.cjs} +1 -1
- package/dist/{connect-DQaDa6i7.cjs → connect-B35YXbdZ.cjs} +11 -11
- package/dist/{connect-D21OhdsD.mjs → connect-C0iLkCiY.mjs} +11 -11
- package/dist/{context-BknomZTq.cjs → context-BmH2BKip.cjs} +1 -1
- package/dist/{context-BTX3YYdt.mjs → context-Ptdnlcv6.mjs} +1 -1
- package/dist/{controlClient-CEpaptre.cjs → controlClient-CtsQMw--.cjs} +3 -3
- package/dist/{controlClient-CbmWgWJW.mjs → controlClient-DqtC0pq1.mjs} +3 -3
- package/dist/{createSessionMetadata-Cgfcg0WZ.cjs → createSessionMetadata-2IuH5nlA.cjs} +2 -2
- package/dist/{createSessionMetadata-CM7ErnPh.mjs → createSessionMetadata-CtNMvfth.mjs} +2 -2
- package/dist/{defaultPermissionMode-DqdkzYUY.cjs → defaultPermissionMode-Bn4HcU8S.cjs} +2 -2
- package/dist/{defaultPermissionMode-CmgCDVpL.mjs → defaultPermissionMode-DYihjV2g.mjs} +2 -2
- package/dist/{deterministicJson-DVvfcibH.mjs → deterministicJson-DF4xv6MH.mjs} +8 -8
- package/dist/{deterministicJson-B3V5Ss2l.cjs → deterministicJson-je21npNx.cjs} +8 -8
- package/dist/{doctor-C_Xfs8Bs.cjs → doctor-BXKcYVGU.cjs} +7 -7
- package/dist/{doctor-CidhGBde.mjs → doctor-Ba92L7-b.mjs} +7 -7
- package/dist/{downloadTarget-C-18yOBz.mjs → downloadTarget-CUJg8iJV.mjs} +6 -6
- package/dist/{downloadTarget-DJKG6wVj.cjs → downloadTarget-JC7FZl7W.cjs} +6 -6
- package/dist/{ensureDaemonRunning-CWo9yDAC.mjs → ensureDaemonRunning-JPA9tHNE.mjs} +5 -5
- package/dist/{ensureDaemonRunning-Dk1yo6aK.cjs → ensureDaemonRunning-bIp6-vgi.cjs} +5 -5
- package/dist/{handleResumeCommand-DvFAI68O.cjs → handleResumeCommand-B6b9kIYf.cjs} +5 -5
- package/dist/{handleResumeCommand-ApqydtLf.mjs → handleResumeCommand-B6lE5DtU.mjs} +5 -5
- package/dist/{index-azi2eHdp.cjs → index-B1ABQRrB.cjs} +4 -4
- package/dist/{index-CXCoTvVd.cjs → index-B2KL0aPc.cjs} +32 -32
- package/dist/{index-D0IWz-WE.mjs → index-CZLwo1FS.mjs} +3 -3
- package/dist/{index-BVC5vBcc.mjs → index-CjE4kBKx.mjs} +33 -33
- package/dist/{index-CjFzrcin.cjs → index-D759ViMU.cjs} +3 -3
- package/dist/{index-CMeZ7WcS.mjs → index-DW1ONaGc.mjs} +4 -4
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BOPmEeSo.mjs → install-CmojqnLK.mjs} +3 -3
- package/dist/{install-DayuanHz.cjs → install-KjIsK_EA.cjs} +3 -3
- package/dist/lib.cjs +10 -10
- package/dist/lib.mjs +10 -10
- package/dist/{lidState-7uLoa43a.cjs → lidState-BmJp2pLt.cjs} +1 -1
- package/dist/{lidState-Bv862v_R.mjs → lidState-CL1NdKfQ.mjs} +1 -1
- package/dist/{localHappyAgentAuth-CfILduPd.cjs → localHappyAgentAuth-9SP7hdiw.cjs} +1 -1
- package/dist/{localHappyAgentAuth-CLP3CBMK.mjs → localHappyAgentAuth-B7f4Ysn0.mjs} +1 -1
- package/dist/{logger-XjIS0lU7.cjs → logger-C7dRaCkE.cjs} +2 -2
- package/dist/{logger-CUxbqfrp.mjs → logger-D5EzMy30.mjs} +2 -2
- package/dist/{machineMetadata-DTxYqMdE.cjs → machineMetadata-DYYuK_0c.cjs} +3 -3
- package/dist/{machineMetadata-QfdvKIrL.mjs → machineMetadata-DqplCWue.mjs} +3 -3
- package/dist/{main-DcfU9Axf.mjs → main-CnV62agu.mjs} +44 -44
- package/dist/{main-BpC52KlL.cjs → main-kgCQgknK.cjs} +44 -44
- package/dist/{mcp-EEwHzYYU.cjs → mcp-BV0vxHtz.cjs} +14 -14
- package/dist/{mcp-BhUNcpoX.mjs → mcp-bDPaj-tM.mjs} +14 -14
- package/dist/{mirrorProtocol-WfE5yd3v.cjs → mirrorProtocol-BSHVZ8Nf.cjs} +2 -2
- package/dist/{mirrorProtocol-BoBu65cj.mjs → mirrorProtocol-ClKhNXYe.mjs} +2 -2
- package/dist/{package-DkI3yDe0.mjs → package-D0dxZ-W8.mjs} +7 -7
- package/dist/{package-DFQUF2in.cjs → package-VqWv7EI5.cjs} +7 -7
- package/dist/{peerTools-zfe59JAw.mjs → peerTools-B_eiNB3P.mjs} +4 -4
- package/dist/{peerTools-DbI6tEk1.cjs → peerTools-BktGmlpd.cjs} +4 -4
- package/dist/{persistence-CBToZ0R6.mjs → persistence-CIIhP0Uw.mjs} +2 -2
- package/dist/{persistence-BO7AS2NK.cjs → persistence-DweHi8xa.cjs} +2 -2
- package/dist/{piRunnerArgs-CICVlVem.cjs → piRunnerArgs-BNzWTNRV.cjs} +1 -1
- package/dist/{piRunnerArgs-C2us7__q.mjs → piRunnerArgs-cQafsadv.mjs} +1 -1
- package/dist/{piRuntime-BYHZYbw6.mjs → piRuntime-Bel5lOLb.mjs} +1 -1
- package/dist/{piRuntime-CTezrTNw.cjs → piRuntime-VZLSwW-4.cjs} +1 -1
- package/dist/{piTerminal-YCRkoVWF.mjs → piTerminal-CS5SDi_H.mjs} +16 -16
- package/dist/{piTerminal-CeiWEB-T.cjs → piTerminal-DkR8sPv-.cjs} +16 -16
- package/dist/{rateLimitWindows-i2-530Zt.mjs → rateLimitWindows-Bo6XVnie.mjs} +1 -1
- package/dist/{rateLimitWindows-U7NsRvIa.cjs → rateLimitWindows-Bp4T21RI.cjs} +1 -1
- package/dist/{registerCommonHandlers-DTeuk3Hw.cjs → registerCommonHandlers-B7QZxkCL.cjs} +2 -2
- package/dist/{registerCommonHandlers-C_KbP5Mq.mjs → registerCommonHandlers-CR5jpiSx.mjs} +2 -2
- package/dist/{registerKillSessionHandler-B_FqygY4.cjs → registerKillSessionHandler-CcX84g-T.cjs} +4 -4
- package/dist/{registerKillSessionHandler-B7zpuzvS.mjs → registerKillSessionHandler-DLiu24CQ.mjs} +4 -4
- package/dist/{remoteSessionClient-D79ci1L8.cjs → remoteSessionClient-CL3akj0K.cjs} +5 -5
- package/dist/{remoteSessionClient-Bk1Qzb5I.mjs → remoteSessionClient-CUjw1COc.mjs} +5 -5
- package/dist/{reportProgressTool-DujvMncK.mjs → reportProgressTool-BLLwMQrN.mjs} +1 -1
- package/dist/{reportProgressTool-oJMMqzKb.cjs → reportProgressTool-DzMi4mvH.cjs} +1 -1
- package/dist/{run-CyiUjBZK.cjs → run-5pmOElaW.cjs} +31 -31
- package/dist/{run-DVE2Gq-E.mjs → run-DGokR_6q.mjs} +30 -30
- package/dist/{runClaude-BcpBew2h.mjs → runClaude-BFlpZQds.mjs} +19 -19
- package/dist/{runClaude-CmAHAR3N.cjs → runClaude-EnYNvkV0.cjs} +19 -19
- package/dist/{runClaudeDeps-Z_RVvcuG.cjs → runClaudeDeps-CUDebE9e.cjs} +32 -32
- package/dist/{runClaudeDeps-C2fTmXoo.mjs → runClaudeDeps-D1M1dzlZ.mjs} +37 -37
- package/dist/{runGemini-Bv4nVBfj.cjs → runGemini-Bu69Zu1u.cjs} +30 -30
- package/dist/{runGemini-BYmVfC3b.mjs → runGemini-Bub8T5cM.mjs} +30 -30
- package/dist/{runOpenClaw-D5suaSgY.cjs → runOpenClaw-Cob5F3FC.cjs} +15 -15
- package/dist/{runOpenClaw-msp2nzW8.mjs → runOpenClaw-DVu73F_i.mjs} +15 -15
- package/dist/{sandbox-CH7xLX1-.mjs → sandbox-9EKOFyQF.mjs} +4 -4
- package/dist/{sandbox-CSnsdXId.cjs → sandbox-GDqMagSF.cjs} +4 -4
- package/dist/selfCheck-CNo4uzGB.mjs +84 -0
- package/dist/{selfCheck-B4mCW5Em.cjs → selfCheck-DiNo34da.cjs} +34 -34
- package/dist/{send-DzRwXl8a.cjs → send-ThC80164.cjs} +8 -8
- package/dist/{send-lrV7t7dr.mjs → send-wgtHphq8.mjs} +8 -8
- package/dist/{server-DBHPW2gs.mjs → server-Bb8v2fOj.mjs} +4 -4
- package/dist/{server-BAwRC79P.cjs → server-bidHnstE.cjs} +6 -6
- package/dist/{sessionLock-ClIuWFru.cjs → sessionLock-BWBcBZKh.cjs} +3 -3
- package/dist/{sessionLock-D_-T15Y-.mjs → sessionLock-gb32sVPR.mjs} +3 -3
- package/dist/{sessionModeFile-BP1s4On2.mjs → sessionModeFile-C-fr1M1h.mjs} +1 -1
- package/dist/{sessionModeFile-BFejyKn5.cjs → sessionModeFile-DhuTNcJr.cjs} +1 -1
- package/dist/{sessionOps-C7wI8Ll6.cjs → sessionOps-9MChM9Op.cjs} +4 -4
- package/dist/{sessionOps-DfAtoDD5.mjs → sessionOps-ByZJbkMq.mjs} +4 -4
- package/dist/{sessionScanner-BJFPUwar.cjs → sessionScanner-BpegdnXK.cjs} +3 -3
- package/dist/{sessionScanner-1-ANJdrm.mjs → sessionScanner-CxXPAVyS.mjs} +3 -3
- package/dist/{sessions-Bi13Rn0K.cjs → sessions-C1X4z_Lm.cjs} +9 -9
- package/dist/{sessions-Dp_X8vP2.mjs → sessions-l-UgJGjV.mjs} +9 -9
- package/dist/{setupOfflineReconnection-BJCXuFad.cjs → setupOfflineReconnection-CS_8Da8R.cjs} +2 -2
- package/dist/{setupOfflineReconnection-D51KXWAP.mjs → setupOfflineReconnection-CgtXlV74.mjs} +2 -2
- package/dist/{spawn-BiYYv0J7.cjs → spawn-D2BlNdZu.cjs} +11 -11
- package/dist/{spawn-DeXPOMMC.mjs → spawn-FyoHqYWo.mjs} +11 -11
- package/dist/{spawnHappyCLI-CrKdy_rv.cjs → spawnHappyCLI-DByQcqEN.cjs} +1 -1
- package/dist/{spawnHappyCLI-CYS23qZY.mjs → spawnHappyCLI-DsC256j_.mjs} +1 -1
- package/dist/{specialCommands-Dkg5wrXd.cjs → specialCommands-DGUeZqdm.cjs} +3 -3
- package/dist/{specialCommands-BbNlcS3G.mjs → specialCommands-DUUBqzvd.mjs} +3 -3
- package/dist/{startFileWatcher-BJ4vTfRp.cjs → startFileWatcher-BtBaahTn.cjs} +1 -1
- package/dist/{startFileWatcher-CgH0PknF.mjs → startFileWatcher-CaYRObJu.mjs} +1 -1
- package/dist/{sync-CGVTRg-R.cjs → sync-BK-IBkuB.cjs} +1 -1
- package/dist/{sync-MTpgBfV2.mjs → sync-D5YqUVjS.mjs} +1 -1
- package/dist/{systemPrompt-DRCJdhNo.cjs → systemPrompt-DaTKLEb-.cjs} +1 -1
- package/dist/{systemPrompt-BMGFnaRU.mjs → systemPrompt-e-qeag_h.mjs} +1 -1
- package/dist/{teams-H_F3UZkh.mjs → teams-ClrppvKu.mjs} +6 -6
- package/dist/{teams-0d4XG2_h.cjs → teams-D9xwa_d3.cjs} +6 -6
- package/dist/{time-ChuhR6SU.cjs → time-0szhiPo4.cjs} +1 -1
- package/dist/{time-7iVn8KLQ.mjs → time-CvrpeD3S.mjs} +1 -1
- package/dist/{titleGenerator-CLdAiwN1.mjs → titleGenerator-BZ5770wq.mjs} +1 -1
- package/dist/{titleGenerator-CozWnU-t.cjs → titleGenerator-Dz5P7sE1.cjs} +2 -2
- package/dist/{todo-BeIYBXws.cjs → todo-CkmNJQey.cjs} +5 -5
- package/dist/{todo-7mtNKrxn.mjs → todo-o-miKcN2.mjs} +5 -5
- package/dist/{tools-9hPR5-u8.cjs → tools-C77-Ssan.cjs} +1 -1
- package/dist/{tools-BSlqfWAq.mjs → tools-Cp0qJeBq.mjs} +1 -1
- package/dist/{uninstall-Bf5MardO.cjs → uninstall-DGUPERDX.cjs} +3 -3
- package/dist/{uninstall-Uei9RnVT.mjs → uninstall-jNJDCLD_.mjs} +3 -3
- package/package.json +7 -7
- package/dist/selfCheck-WbfDqlfQ.mjs +0 -84
|
@@ -4,19 +4,19 @@ var spawn = require('cross-spawn');
|
|
|
4
4
|
var node_readline = require('node:readline');
|
|
5
5
|
var node_fs = require('node:fs');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
|
-
var logger = require('./logger-
|
|
7
|
+
var logger = require('./logger-C7dRaCkE.cjs');
|
|
8
8
|
var smallFastModel = require('./smallFastModel-D_uxGMo3.cjs');
|
|
9
9
|
var path$1 = require('node:path');
|
|
10
10
|
var path = require('./path-B7zW-WwE.cjs');
|
|
11
|
-
var systemPrompt = require('./systemPrompt-
|
|
11
|
+
var systemPrompt = require('./systemPrompt-DaTKLEb-.cjs');
|
|
12
12
|
var manager = require('./manager-HrEj442o.cjs');
|
|
13
13
|
var contentLogMetadata = require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
14
14
|
var claudeCliPath = require('./claudeCliPath-U4HHmV4r.cjs');
|
|
15
15
|
require('chalk');
|
|
16
16
|
require('node:util');
|
|
17
|
-
require('./configuration-
|
|
17
|
+
require('./configuration-UV4EE5ui.cjs');
|
|
18
18
|
require('node:os');
|
|
19
|
-
require('./package-
|
|
19
|
+
require('./package-VqWv7EI5.cjs');
|
|
20
20
|
require('node:fs/promises');
|
|
21
21
|
require('./index-BZdhwBKa.cjs');
|
|
22
22
|
require('zod');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { l as logger } from './logger-
|
|
2
|
-
import { claudeLocal, ExitCodeError } from './claudeLocal-
|
|
3
|
-
import { c as createSessionScanner, F as Future } from './sessionScanner-
|
|
1
|
+
import { l as logger } from './logger-D5EzMy30.mjs';
|
|
2
|
+
import { claudeLocal, ExitCodeError } from './claudeLocal-B0P-wVJJ.mjs';
|
|
3
|
+
import { c as createSessionScanner, F as Future } from './sessionScanner-CxXPAVyS.mjs';
|
|
4
4
|
import 'chalk';
|
|
5
5
|
import 'node:util';
|
|
6
|
-
import './configuration-
|
|
6
|
+
import './configuration-BNGPXg07.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'node:path';
|
|
10
|
-
import './package-
|
|
10
|
+
import './package-D0dxZ-W8.mjs';
|
|
11
11
|
import 'node:fs/promises';
|
|
12
12
|
import 'cross-spawn';
|
|
13
13
|
import 'node:readline';
|
|
14
14
|
import 'node:crypto';
|
|
15
15
|
import './smallFastModel-BLNgMrwR.mjs';
|
|
16
16
|
import './path-D2wdaNSk.mjs';
|
|
17
|
-
import './systemPrompt-
|
|
17
|
+
import './systemPrompt-e-qeag_h.mjs';
|
|
18
18
|
import './index-boE-d8CM.mjs';
|
|
19
19
|
import 'zod';
|
|
20
20
|
import '@paralleldrive/cuid2';
|
|
@@ -27,11 +27,11 @@ import './claudeCliPath-BqkaH2oR.mjs';
|
|
|
27
27
|
import './projectPath-BTBIMB57.mjs';
|
|
28
28
|
import 'path';
|
|
29
29
|
import 'url';
|
|
30
|
-
import './sync-
|
|
31
|
-
import './time-
|
|
30
|
+
import './sync-D5YqUVjS.mjs';
|
|
31
|
+
import './time-CvrpeD3S.mjs';
|
|
32
32
|
import './types-CkqAACXx.mjs';
|
|
33
33
|
import './transcriptCursor-B7T_gkQ0.mjs';
|
|
34
|
-
import './startFileWatcher-
|
|
34
|
+
import './startFileWatcher-CaYRObJu.mjs';
|
|
35
35
|
import 'fs/promises';
|
|
36
36
|
|
|
37
37
|
async function claudeLocalLauncher(session) {
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./logger-
|
|
4
|
-
var claudeLocal = require('./claudeLocal-
|
|
5
|
-
var sessionScanner = require('./sessionScanner-
|
|
3
|
+
var logger = require('./logger-C7dRaCkE.cjs');
|
|
4
|
+
var claudeLocal = require('./claudeLocal-CtZVz3ee.cjs');
|
|
5
|
+
var sessionScanner = require('./sessionScanner-BpegdnXK.cjs');
|
|
6
6
|
require('chalk');
|
|
7
7
|
require('node:util');
|
|
8
|
-
require('./configuration-
|
|
8
|
+
require('./configuration-UV4EE5ui.cjs');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:os');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./package-
|
|
12
|
+
require('./package-VqWv7EI5.cjs');
|
|
13
13
|
require('node:fs/promises');
|
|
14
14
|
require('cross-spawn');
|
|
15
15
|
require('node:readline');
|
|
16
16
|
require('node:crypto');
|
|
17
17
|
require('./smallFastModel-D_uxGMo3.cjs');
|
|
18
18
|
require('./path-B7zW-WwE.cjs');
|
|
19
|
-
require('./systemPrompt-
|
|
19
|
+
require('./systemPrompt-DaTKLEb-.cjs');
|
|
20
20
|
require('./index-BZdhwBKa.cjs');
|
|
21
21
|
require('zod');
|
|
22
22
|
require('@paralleldrive/cuid2');
|
|
@@ -29,11 +29,11 @@ require('./claudeCliPath-U4HHmV4r.cjs');
|
|
|
29
29
|
require('./projectPath-ChLhdOyt.cjs');
|
|
30
30
|
require('path');
|
|
31
31
|
require('url');
|
|
32
|
-
require('./sync-
|
|
33
|
-
require('./time-
|
|
32
|
+
require('./sync-BK-IBkuB.cjs');
|
|
33
|
+
require('./time-0szhiPo4.cjs');
|
|
34
34
|
require('./types-CRS-srZK.cjs');
|
|
35
35
|
require('./transcriptCursor-DcXGLeSc.cjs');
|
|
36
|
-
require('./startFileWatcher-
|
|
36
|
+
require('./startFileWatcher-BtBaahTn.cjs');
|
|
37
37
|
require('fs/promises');
|
|
38
38
|
|
|
39
39
|
async function claudeLocalLauncher(session) {
|
|
@@ -3,7 +3,7 @@ import { copyFile, unlink, readFile, rename, writeFile } from 'node:fs/promises'
|
|
|
3
3
|
import { createReadStream, createWriteStream } from 'node:fs';
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { createInterface } from 'node:readline';
|
|
6
|
-
import { l as logger } from './logger-
|
|
6
|
+
import { l as logger } from './logger-D5EzMy30.mjs';
|
|
7
7
|
|
|
8
8
|
class ForkTruncateUuidNotFoundError extends Error {
|
|
9
9
|
constructor(cutAfterUuid, sourcePath) {
|
|
@@ -5,7 +5,7 @@ var promises = require('node:fs/promises');
|
|
|
5
5
|
var node_fs = require('node:fs');
|
|
6
6
|
var path = require('node:path');
|
|
7
7
|
var node_readline = require('node:readline');
|
|
8
|
-
var logger = require('./logger-
|
|
8
|
+
var logger = require('./logger-C7dRaCkE.cjs');
|
|
9
9
|
|
|
10
10
|
class ForkTruncateUuidNotFoundError extends Error {
|
|
11
11
|
constructor(cutAfterUuid, sourcePath) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
|
-
var configuration = require('./configuration-
|
|
5
|
-
var persistence = require('./persistence-
|
|
6
|
-
var context = require('./context-
|
|
4
|
+
var configuration = require('./configuration-UV4EE5ui.cjs');
|
|
5
|
+
var persistence = require('./persistence-DweHi8xa.cjs');
|
|
6
|
+
var context = require('./context-BmH2BKip.cjs');
|
|
7
7
|
|
|
8
8
|
async function teamRequest(path, method, token, scoped, body) {
|
|
9
9
|
const response = await fetch(`${configuration.configuration.serverUrl}${path}`, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var configuration = require('./configuration-
|
|
4
|
-
var persistence = require('./persistence-
|
|
3
|
+
var configuration = require('./configuration-UV4EE5ui.cjs');
|
|
4
|
+
var persistence = require('./persistence-DweHi8xa.cjs');
|
|
5
5
|
|
|
6
6
|
class AutomationsRequestError extends Error {
|
|
7
7
|
constructor(status, code, runStatus) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as configuration } from './configuration-
|
|
2
|
-
import { c as readCredentialsForConfiguredRelay, r as readSettings } from './persistence-
|
|
1
|
+
import { c as configuration } from './configuration-BNGPXg07.mjs';
|
|
2
|
+
import { c as readCredentialsForConfiguredRelay, r as readSettings } from './persistence-CIIhP0Uw.mjs';
|
|
3
3
|
|
|
4
4
|
class AutomationsRequestError extends Error {
|
|
5
5
|
constructor(status, code, runStatus) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
3
|
-
import { r as readSettings, b as readPersistedSessions, c as readCredentialsForConfiguredRelay } from './persistence-
|
|
4
|
-
import { r as readTeamScope, t as teamScopePath, w as writeTeamScope } from './context-
|
|
2
|
+
import { c as configuration } from './configuration-BNGPXg07.mjs';
|
|
3
|
+
import { r as readSettings, b as readPersistedSessions, c as readCredentialsForConfiguredRelay } from './persistence-CIIhP0Uw.mjs';
|
|
4
|
+
import { r as readTeamScope, t as teamScopePath, w as writeTeamScope } from './context-Ptdnlcv6.mjs';
|
|
5
5
|
|
|
6
6
|
async function teamRequest(path, method, token, scoped, body) {
|
|
7
7
|
const response = await fetch(`${configuration.serverUrl}${path}`, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tools = require('../tools-
|
|
4
|
-
var reportProgressTool = require('../reportProgressTool-
|
|
5
|
-
var peerTools = require('../peerTools-
|
|
3
|
+
var tools = require('../tools-C77-Ssan.cjs');
|
|
4
|
+
var reportProgressTool = require('../reportProgressTool-DzMi4mvH.cjs');
|
|
5
|
+
var peerTools = require('../peerTools-BktGmlpd.cjs');
|
|
6
6
|
var agentGuidance = require('../agentGuidance-BtBx2xxE.cjs');
|
|
7
7
|
var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
|
|
8
8
|
var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
|
|
@@ -10,33 +10,33 @@ var index_js = require('@modelcontextprotocol/sdk/client/index.js');
|
|
|
10
10
|
var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
|
|
11
11
|
var z = require('zod');
|
|
12
12
|
var limits = require('../limits-C-a7gr04.cjs');
|
|
13
|
-
require('../client-
|
|
13
|
+
require('../client-BHZVyQwi.cjs');
|
|
14
14
|
require('node:crypto');
|
|
15
|
-
require('../configuration-
|
|
15
|
+
require('../configuration-UV4EE5ui.cjs');
|
|
16
16
|
require('node:fs');
|
|
17
17
|
require('node:os');
|
|
18
18
|
require('node:path');
|
|
19
|
-
require('../package-
|
|
19
|
+
require('../package-VqWv7EI5.cjs');
|
|
20
20
|
require('node:fs/promises');
|
|
21
|
-
require('../persistence-
|
|
21
|
+
require('../persistence-DweHi8xa.cjs');
|
|
22
22
|
require('../authRelay-BdYkC1Po.cjs');
|
|
23
23
|
require('tweetnacl');
|
|
24
|
-
require('../logger-
|
|
24
|
+
require('../logger-C7dRaCkE.cjs');
|
|
25
25
|
require('chalk');
|
|
26
26
|
require('node:util');
|
|
27
|
-
require('../context-
|
|
27
|
+
require('../context-BmH2BKip.cjs');
|
|
28
28
|
require('../index-BZdhwBKa.cjs');
|
|
29
29
|
require('@paralleldrive/cuid2');
|
|
30
|
-
require('../client-
|
|
30
|
+
require('../client-BhLhjj_x.cjs');
|
|
31
31
|
require('../precheckCompat-CWOi5c9L.cjs');
|
|
32
32
|
require('../ids-B6ZC0HGt.cjs');
|
|
33
|
-
require('../controlClient-
|
|
34
|
-
require('../sessionOps-
|
|
33
|
+
require('../controlClient-CtsQMw--.cjs');
|
|
34
|
+
require('../sessionOps-9MChM9Op.cjs');
|
|
35
35
|
require('axios');
|
|
36
|
-
require('../time-
|
|
36
|
+
require('../time-0szhiPo4.cjs');
|
|
37
37
|
require('socket.io-client');
|
|
38
38
|
require('../backgroundTaskActivity-CBvUdj39.cjs');
|
|
39
|
-
require('../remoteSessionClient-
|
|
39
|
+
require('../remoteSessionClient-CL3akj0K.cjs');
|
|
40
40
|
require('../trimIdent-4gvk9Wk6.cjs');
|
|
41
41
|
|
|
42
42
|
function parseArgs(argv) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerTeamsTools } from '../tools-
|
|
2
|
-
import { r as registerAutomationTools, a as registerReportProgressTool } from '../reportProgressTool-
|
|
3
|
-
import { r as registerSessionPeerTools } from '../peerTools-
|
|
1
|
+
import { r as registerTeamsTools } from '../tools-Cp0qJeBq.mjs';
|
|
2
|
+
import { r as registerAutomationTools, a as registerReportProgressTool } from '../reportProgressTool-BLLwMQrN.mjs';
|
|
3
|
+
import { r as registerSessionPeerTools } from '../peerTools-B_eiNB3P.mjs';
|
|
4
4
|
import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, c as PREVIEW_DOWNLOAD_PARAM_DESCRIPTION, R as REPORT_PROGRESS_TOOL_NAME } from '../agentGuidance-BDYt2Qy2.mjs';
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
@@ -8,33 +8,33 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
|
8
8
|
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-DIo7rEBR.mjs';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-eQjOvC55.mjs';
|
|
12
12
|
import 'node:crypto';
|
|
13
|
-
import '../configuration-
|
|
13
|
+
import '../configuration-BNGPXg07.mjs';
|
|
14
14
|
import 'node:fs';
|
|
15
15
|
import 'node:os';
|
|
16
16
|
import 'node:path';
|
|
17
|
-
import '../package-
|
|
17
|
+
import '../package-D0dxZ-W8.mjs';
|
|
18
18
|
import 'node:fs/promises';
|
|
19
|
-
import '../persistence-
|
|
19
|
+
import '../persistence-CIIhP0Uw.mjs';
|
|
20
20
|
import '../authRelay-DSAvg1uv.mjs';
|
|
21
21
|
import 'tweetnacl';
|
|
22
|
-
import '../logger-
|
|
22
|
+
import '../logger-D5EzMy30.mjs';
|
|
23
23
|
import 'chalk';
|
|
24
24
|
import 'node:util';
|
|
25
|
-
import '../context-
|
|
25
|
+
import '../context-Ptdnlcv6.mjs';
|
|
26
26
|
import '../index-boE-d8CM.mjs';
|
|
27
27
|
import '@paralleldrive/cuid2';
|
|
28
|
-
import '../client-
|
|
28
|
+
import '../client-C4ddTzrD.mjs';
|
|
29
29
|
import '../precheckCompat-DeEbilbr.mjs';
|
|
30
30
|
import '../ids-DU6sLx4C.mjs';
|
|
31
|
-
import '../controlClient-
|
|
32
|
-
import '../sessionOps-
|
|
31
|
+
import '../controlClient-DqtC0pq1.mjs';
|
|
32
|
+
import '../sessionOps-ByZJbkMq.mjs';
|
|
33
33
|
import 'axios';
|
|
34
|
-
import '../time-
|
|
34
|
+
import '../time-CvrpeD3S.mjs';
|
|
35
35
|
import 'socket.io-client';
|
|
36
36
|
import '../backgroundTaskActivity-8PdPxrvy.mjs';
|
|
37
|
-
import '../remoteSessionClient-
|
|
37
|
+
import '../remoteSessionClient-CUjw1COc.mjs';
|
|
38
38
|
import '../trimIdent-BAjmv_TG.mjs';
|
|
39
39
|
|
|
40
40
|
function parseArgs(argv) {
|
|
@@ -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-D5EzMy30.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-D0dxZ-W8.mjs';
|
|
8
|
+
import { s as shouldReadCodexRateLimits, i as isUnsupportedCodexMethodError } from './rateLimitWindows-Bo6XVnie.mjs';
|
|
9
9
|
|
|
10
10
|
function isAppServerAvailable() {
|
|
11
11
|
try {
|
|
@@ -89,7 +89,6 @@ class CodexAppServerClient {
|
|
|
89
89
|
_turnId = null;
|
|
90
90
|
threadDefaults = null;
|
|
91
91
|
// Turn completion tracking for the currently active sendTurnAndWait call.
|
|
92
|
-
// A completion event only resolves once we have seen task_started for this turn.
|
|
93
92
|
pendingTurnCompletion = null;
|
|
94
93
|
// Tracks in-flight interruptTurn() RPCs so sendTurnAndWait can wait for them
|
|
95
94
|
// before starting a new turn (prevents stale turn/interrupt from aborting the next turn).
|
|
@@ -99,6 +98,22 @@ class CodexAppServerClient {
|
|
|
99
98
|
idleRelease = null;
|
|
100
99
|
notificationProtocol = "unknown";
|
|
101
100
|
completedTurnIds = /* @__PURE__ */ new Set();
|
|
101
|
+
/** B-625: turns whose failure has already been forwarded, so a second failed frame is not. */
|
|
102
|
+
failedTurnIds = /* @__PURE__ */ new Set();
|
|
103
|
+
// B-625: the app-server speaks for every thread it hosts — the session's own and the
|
|
104
|
+
// children `spawn_agent` opens — so a lifecycle frame (turn/started, turn/completed,
|
|
105
|
+
// thread/status/changed, error, thread/closed) is the session's only when its `threadId`
|
|
106
|
+
// is ours; a frame naming no thread belongs to the thread it was asked on (Orca's rule,
|
|
107
|
+
// src/main/codex/codex-structured-turn-open-wait.ts). Before this, a child's
|
|
108
|
+
// `turn/completed` ended the parent's turn in the UI and a child's `turn/started`
|
|
109
|
+
// retargeted `turn/interrupt` at the child.
|
|
110
|
+
/** The own thread's last turn-ending `error` (willRetry=false), for a turn end that arrives without a verdict. */
|
|
111
|
+
lastTurnError = null;
|
|
112
|
+
/** Own thread reported idle/systemError while a turn was pending: Codex's `turn/completed`
|
|
113
|
+
* follows within a millisecond; this ends the turn if it does not (see armThreadStopGrace). */
|
|
114
|
+
threadStopGrace = null;
|
|
115
|
+
/** Last few hundred chars of the app-server's stderr: Codex's own last words when it dies. */
|
|
116
|
+
stderrRing = "";
|
|
102
117
|
rawFileChangesByItemId = /* @__PURE__ */ new Map();
|
|
103
118
|
// B-622: inactivity watchdog for the pending turn — re-armed by every
|
|
104
119
|
// notification, never a cap on how long a turn may run (see sendTurnAndWait).
|
|
@@ -167,8 +182,21 @@ class CodexAppServerClient {
|
|
|
167
182
|
const status = params?.turn?.status ?? params?.status ?? null;
|
|
168
183
|
return typeof status === "string" && status.length > 0 ? status : null;
|
|
169
184
|
}
|
|
185
|
+
extractThreadId(params) {
|
|
186
|
+
const threadId = params?.threadId ?? params?.thread_id ?? params?.thread?.id ?? null;
|
|
187
|
+
return typeof threadId === "string" && threadId.length > 0 ? threadId : null;
|
|
188
|
+
}
|
|
189
|
+
/** B-625: whether a lifecycle frame is about the session's own thread (see the field comment). */
|
|
190
|
+
isOwnThreadFrame(params) {
|
|
191
|
+
const threadId = this.extractThreadId(params);
|
|
192
|
+
return threadId === null || this._threadId === null || threadId === this._threadId;
|
|
193
|
+
}
|
|
194
|
+
/** Codex's last stderr lines, one line, for a message a person reads. */
|
|
195
|
+
stderrTail() {
|
|
196
|
+
return this.stderrRing.replace(/\x1b\[[0-9;]*m/g, "").replace(/\s+/g, " ").trim();
|
|
197
|
+
}
|
|
170
198
|
shouldHandleRawNotification(method) {
|
|
171
|
-
const isRawNotification = method === "thread/started" || method === "turn/started" || method === "turn/completed" || method === "thread/status/changed" || method === "thread/tokenUsage/updated" || method.startsWith("item/");
|
|
199
|
+
const isRawNotification = method === "thread/started" || method === "turn/started" || method === "turn/completed" || method === "thread/status/changed" || method === "thread/closed" || method === "thread/tokenUsage/updated" || method.startsWith("item/");
|
|
172
200
|
if (!isRawNotification) {
|
|
173
201
|
return false;
|
|
174
202
|
}
|
|
@@ -183,14 +211,19 @@ class CodexAppServerClient {
|
|
|
183
211
|
emitRawTurnCompletion(turnId, status, error, source) {
|
|
184
212
|
const aborted = status === "cancelled" || status === "canceled" || status === "aborted" || status === "interrupted";
|
|
185
213
|
const failed = status === "failed" || error !== void 0 && error !== null;
|
|
214
|
+
this.clearThreadStopGrace();
|
|
186
215
|
this.tryResolvePendingTurn(aborted, turnId, source);
|
|
187
216
|
this._turnId = null;
|
|
188
217
|
this.maybeRefreshRateLimits();
|
|
218
|
+
if (this.lastTurnError && (!turnId || !this.lastTurnError.turnId || this.lastTurnError.turnId === turnId)) {
|
|
219
|
+
this.lastTurnError = null;
|
|
220
|
+
}
|
|
189
221
|
if (turnId && this.completedTurnIds.has(turnId)) {
|
|
190
|
-
if (!failed) return;
|
|
222
|
+
if (!failed || this.failedTurnIds.has(turnId)) return;
|
|
191
223
|
}
|
|
192
224
|
if (turnId) {
|
|
193
225
|
this.completedTurnIds.add(turnId);
|
|
226
|
+
if (failed) this.failedTurnIds.add(turnId);
|
|
194
227
|
}
|
|
195
228
|
if (aborted) {
|
|
196
229
|
this.eventHandler?.({
|
|
@@ -213,6 +246,10 @@ class CodexAppServerClient {
|
|
|
213
246
|
return false;
|
|
214
247
|
}
|
|
215
248
|
if (method === "turn/started") {
|
|
249
|
+
if (!this.isOwnThreadFrame(params)) {
|
|
250
|
+
logger.debug(`[CodexAppServer] Child thread ${this.extractThreadId(params)} started a turn`);
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
216
253
|
const turnId = this.extractTurnId(params);
|
|
217
254
|
if (turnId) {
|
|
218
255
|
this._turnId = turnId;
|
|
@@ -225,6 +262,10 @@ class CodexAppServerClient {
|
|
|
225
262
|
return true;
|
|
226
263
|
}
|
|
227
264
|
if (method === "turn/completed") {
|
|
265
|
+
if (!this.isOwnThreadFrame(params)) {
|
|
266
|
+
logger.debug(`[CodexAppServer] Child thread ${this.extractThreadId(params)} ended a turn`);
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
228
269
|
this.emitRawTurnCompletion(
|
|
229
270
|
this.extractTurnId(params),
|
|
230
271
|
this.extractTurnStatus(params),
|
|
@@ -234,9 +275,23 @@ class CodexAppServerClient {
|
|
|
234
275
|
return true;
|
|
235
276
|
}
|
|
236
277
|
if (method === "thread/status/changed") {
|
|
278
|
+
if (!this.isOwnThreadFrame(params)) return true;
|
|
237
279
|
const statusType = params?.status?.type;
|
|
238
|
-
if (statusType === "idle" && this.pendingTurnCompletion) {
|
|
239
|
-
this.
|
|
280
|
+
if ((statusType === "idle" || statusType === "systemError") && this.pendingTurnCompletion?.opened) {
|
|
281
|
+
this.armThreadStopGrace(statusType);
|
|
282
|
+
} else if (statusType === "active") {
|
|
283
|
+
this.clearThreadStopGrace();
|
|
284
|
+
}
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
if (method === "thread/closed") {
|
|
288
|
+
if (this.isOwnThreadFrame(params) && this.pendingTurnCompletion) {
|
|
289
|
+
this.emitRawTurnCompletion(
|
|
290
|
+
this.pendingTurnCompletion.turnId ?? this._turnId,
|
|
291
|
+
"aborted",
|
|
292
|
+
{ message: "Codex closed the thread before the turn ended." },
|
|
293
|
+
method
|
|
294
|
+
);
|
|
240
295
|
}
|
|
241
296
|
return true;
|
|
242
297
|
}
|
|
@@ -382,17 +437,35 @@ class CodexAppServerClient {
|
|
|
382
437
|
return;
|
|
383
438
|
}
|
|
384
439
|
this.connected = false;
|
|
440
|
+
const tail = this.stderrTail();
|
|
441
|
+
const exited = `Codex process exited (code=${code ?? "null"}${signal ? `, signal=${signal}` : ""})`;
|
|
385
442
|
for (const [id, req] of this.pending) {
|
|
386
443
|
if (req.epoch !== epoch) continue;
|
|
387
|
-
|
|
444
|
+
const error = new Error(`${exited} while waiting for ${req.method}`);
|
|
445
|
+
error.codexStderrTail = tail;
|
|
446
|
+
req.reject(error);
|
|
388
447
|
this.pending.delete(id);
|
|
389
448
|
}
|
|
449
|
+
if (this.pendingTurnCompletion) {
|
|
450
|
+
const turnId = this.pendingTurnCompletion.turnId ?? this._turnId;
|
|
451
|
+
this.eventHandler?.({
|
|
452
|
+
type: "turn_aborted",
|
|
453
|
+
reason: "process-exit",
|
|
454
|
+
...turnId ? { turn_id: turnId } : {},
|
|
455
|
+
error: { message: `${exited}${tail ? `: ${tail}` : ""}` }
|
|
456
|
+
});
|
|
457
|
+
}
|
|
390
458
|
this.resolvePendingTurn(true);
|
|
391
459
|
});
|
|
460
|
+
this.stderrRing = "";
|
|
392
461
|
proc.stderr?.on("data", (chunk) => {
|
|
393
462
|
if (this.process !== proc || this.processEpoch !== epoch) return;
|
|
394
463
|
const text = chunk.toString().trim();
|
|
395
|
-
if (text)
|
|
464
|
+
if (text) {
|
|
465
|
+
logger.debug("[CodexAppServer:stderr]", contentLogMetadata(text));
|
|
466
|
+
this.stderrRing = `${this.stderrRing}
|
|
467
|
+
${text}`.slice(-400);
|
|
468
|
+
}
|
|
396
469
|
});
|
|
397
470
|
this.readline = createInterface({ input: proc.stdout });
|
|
398
471
|
this.readline.on("line", (line) => {
|
|
@@ -443,6 +516,9 @@ class CodexAppServerClient {
|
|
|
443
516
|
this._turnId = null;
|
|
444
517
|
this.notificationProtocol = "unknown";
|
|
445
518
|
this.completedTurnIds.clear();
|
|
519
|
+
this.failedTurnIds.clear();
|
|
520
|
+
this.lastTurnError = null;
|
|
521
|
+
this.clearThreadStopGrace();
|
|
446
522
|
if (!opts?.preserveThreadState) {
|
|
447
523
|
this._threadId = null;
|
|
448
524
|
this.threadDefaults = null;
|
|
@@ -661,15 +737,49 @@ class CodexAppServerClient {
|
|
|
661
737
|
resolvePendingTurn(aborted) {
|
|
662
738
|
if (!this.pendingTurnCompletion) return;
|
|
663
739
|
this.clearTurnWatchdog();
|
|
740
|
+
this.clearThreadStopGrace();
|
|
664
741
|
this.pendingTurnCompletion.resolve(aborted);
|
|
665
742
|
this.pendingTurnCompletion = null;
|
|
666
743
|
}
|
|
667
744
|
markPendingTurnStarted(turnId) {
|
|
668
745
|
if (!this.pendingTurnCompletion) return;
|
|
746
|
+
this.pendingTurnCompletion.opened = true;
|
|
669
747
|
if (turnId) {
|
|
670
748
|
this.pendingTurnCompletion.turnId = turnId;
|
|
671
749
|
}
|
|
672
750
|
}
|
|
751
|
+
/** Default wait for Codex's `turn/completed` after its thread reported idle/systemError. */
|
|
752
|
+
static THREAD_STOP_GRACE_MS = 1500;
|
|
753
|
+
/**
|
|
754
|
+
* B-625: the own thread stopped (idle / systemError) while a turn was pending and
|
|
755
|
+
* had opened. Codex's `turn/completed` follows at once in every probed release
|
|
756
|
+
* (0.154.0: 1 ms); this is the net under a release that does not send it, so the
|
|
757
|
+
* session never waits on the silence watchdog for a turn Codex has already left.
|
|
758
|
+
*/
|
|
759
|
+
armThreadStopGrace(statusType) {
|
|
760
|
+
this.clearThreadStopGrace();
|
|
761
|
+
const graceMs = this.pendingTurnCompletion?.threadStopGraceMs ?? CodexAppServerClient.THREAD_STOP_GRACE_MS;
|
|
762
|
+
this.threadStopGrace = setTimeout(() => {
|
|
763
|
+
this.threadStopGrace = null;
|
|
764
|
+
const pending = this.pendingTurnCompletion;
|
|
765
|
+
if (!pending) return;
|
|
766
|
+
const turnId = pending.turnId ?? this._turnId;
|
|
767
|
+
const lastError = this.lastTurnError && (!turnId || !this.lastTurnError.turnId || this.lastTurnError.turnId === turnId) ? this.lastTurnError.error : null;
|
|
768
|
+
logger.warn(`[CodexAppServer] Thread went ${statusType} and no turn/completed followed for turn ${turnId ?? "?"}; ending the turn`);
|
|
769
|
+
const failed = statusType === "systemError" || lastError !== null;
|
|
770
|
+
this.emitRawTurnCompletion(
|
|
771
|
+
turnId,
|
|
772
|
+
failed ? "failed" : "completed",
|
|
773
|
+
lastError ?? (failed ? { message: "Codex reported a system error and ended the turn without a verdict." } : null),
|
|
774
|
+
`thread/status/changed:${statusType}`
|
|
775
|
+
);
|
|
776
|
+
}, graceMs);
|
|
777
|
+
}
|
|
778
|
+
clearThreadStopGrace() {
|
|
779
|
+
if (!this.threadStopGrace) return;
|
|
780
|
+
clearTimeout(this.threadStopGrace);
|
|
781
|
+
this.threadStopGrace = null;
|
|
782
|
+
}
|
|
673
783
|
tryResolvePendingTurn(aborted, turnId, source) {
|
|
674
784
|
const pending = this.pendingTurnCompletion;
|
|
675
785
|
if (!pending) return;
|
|
@@ -771,6 +881,8 @@ class CodexAppServerClient {
|
|
|
771
881
|
}
|
|
772
882
|
/** Default timeout for waiting on turn completion (ms). 10 minutes. */
|
|
773
883
|
static TURN_TIMEOUT_MS = 10 * 60 * 1e3;
|
|
884
|
+
/** How much of the app-server's stderr is kept for its exit message. */
|
|
885
|
+
static STDERR_TAIL_CHARS = 400;
|
|
774
886
|
/**
|
|
775
887
|
* Send a user turn and wait for it to complete (task_complete or turn_aborted).
|
|
776
888
|
* Returns { aborted: true } if the turn was aborted (user cancel, permission reject, etc.).
|
|
@@ -785,8 +897,11 @@ class CodexAppServerClient {
|
|
|
785
897
|
const completion = new Promise((resolve) => {
|
|
786
898
|
this.pendingTurnCompletion = {
|
|
787
899
|
resolve,
|
|
788
|
-
turnId: null
|
|
900
|
+
turnId: null,
|
|
901
|
+
opened: false,
|
|
902
|
+
threadStopGraceMs: opts?.threadStopGraceMs ?? CodexAppServerClient.THREAD_STOP_GRACE_MS
|
|
789
903
|
};
|
|
904
|
+
this.lastTurnError = null;
|
|
790
905
|
this.armTurnWatchdog(timeoutMs);
|
|
791
906
|
});
|
|
792
907
|
try {
|
|
@@ -866,6 +981,8 @@ class CodexAppServerClient {
|
|
|
866
981
|
this._turnId = null;
|
|
867
982
|
this.threadDefaults = null;
|
|
868
983
|
this.completedTurnIds.clear();
|
|
984
|
+
this.failedTurnIds.clear();
|
|
985
|
+
this.lastTurnError = null;
|
|
869
986
|
this.rawFileChangesByItemId.clear();
|
|
870
987
|
}
|
|
871
988
|
// ─── JSON-RPC transport ─────────────────────────────────────
|
|
@@ -1134,6 +1251,7 @@ class CodexAppServerClient {
|
|
|
1134
1251
|
}
|
|
1135
1252
|
if (method === "thread/started" || method === "turn/started" || method === "turn/completed" || method === "thread/status/changed") {
|
|
1136
1253
|
logger.debug(`[CodexAppServer] Lifecycle notification: ${method}`);
|
|
1254
|
+
if (!this.isOwnThreadFrame(params)) return;
|
|
1137
1255
|
if (method === "turn/started") {
|
|
1138
1256
|
const turnId = this.extractTurnId(params);
|
|
1139
1257
|
if (turnId) {
|
|
@@ -1160,19 +1278,28 @@ class CodexAppServerClient {
|
|
|
1160
1278
|
logger.debug(`[CodexAppServer] mcpServer startup status:`, params);
|
|
1161
1279
|
return;
|
|
1162
1280
|
}
|
|
1163
|
-
if (method === "error"
|
|
1281
|
+
if (method === "error") {
|
|
1282
|
+
if (!this.isOwnThreadFrame(params)) return;
|
|
1164
1283
|
const error = params?.error ?? {};
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1284
|
+
const turnId = typeof params?.turnId === "string" && params.turnId.length > 0 ? params.turnId : null;
|
|
1285
|
+
if (params?.willRetry === true) {
|
|
1286
|
+
const message = typeof error.message === "string" ? error.message : "";
|
|
1287
|
+
const info = error.codexErrorInfo;
|
|
1288
|
+
const httpStatus = info && typeof info === "object" ? info.responseStreamDisconnected?.httpStatusCode ?? info.httpStatusCode ?? null : null;
|
|
1289
|
+
this.eventHandler?.({
|
|
1290
|
+
type: "turn_retry",
|
|
1291
|
+
message,
|
|
1292
|
+
...typeof httpStatus === "number" ? { http_status: httpStatus } : {},
|
|
1293
|
+
...turnId ? { turn_id: turnId } : {},
|
|
1294
|
+
...typeof error.additionalDetails === "string" ? { details: error.additionalDetails } : {}
|
|
1295
|
+
});
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
this.lastTurnError = { turnId, error };
|
|
1299
|
+
const pending = this.pendingTurnCompletion;
|
|
1300
|
+
if (pending && !pending.opened && (turnId === null || pending.turnId === null || pending.turnId === turnId)) {
|
|
1301
|
+
this.emitRawTurnCompletion(turnId ?? pending.turnId, "failed", error, "error:unopened-turn");
|
|
1302
|
+
}
|
|
1176
1303
|
return;
|
|
1177
1304
|
}
|
|
1178
1305
|
logger.debug(`[CodexAppServer] Notification: ${method}`);
|