very-happy-cli 0.2.177 → 0.2.179
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-B0K0WrtW.mjs → AcpBackend-CHp3y7cb.mjs} +135 -16
- package/dist/{AcpBackend-B-ny68XM.cjs → AcpBackend-DFipFF7-.cjs} +135 -16
- package/dist/{AcpSessionManager-CjdJLofq.cjs → AcpSessionManager-0zpvRJXc.cjs} +38 -4
- package/dist/{AcpSessionManager-DykjzBM4.mjs → AcpSessionManager-d2-rKWWa.mjs} +38 -4
- package/dist/{BasePermissionHandler-DR6nxuEn.cjs → BasePermissionHandler-CH3zuEkA.cjs} +5 -2
- package/dist/{BasePermissionHandler-hdY7kTqX.mjs → BasePermissionHandler-DdZBYIR4.mjs} +5 -2
- package/dist/acpSessionResume-DTGmAPLt.mjs +67 -0
- package/dist/acpSessionResume-oiCBnAVA.cjs +74 -0
- package/dist/{agentHome-BdTXEUPe.cjs → agentHome-BWcz8mz0.cjs} +5 -5
- package/dist/{agentHome-GRN2VfHv.mjs → agentHome-CghLvL_1.mjs} +5 -5
- package/dist/{api-BWX10o97.cjs → api-Cmjfr8Z7.cjs} +29 -261
- package/dist/{api-CKBViqI3.mjs → api-CzwFpJQc.mjs} +22 -254
- package/dist/{apiMachine-DttO4UFj.mjs → apiMachine-DJkTEiqy.mjs} +53 -16
- package/dist/{apiMachine-BYYFGgFs.cjs → apiMachine-G6OogT08.cjs} +53 -16
- package/dist/{attachmentContent-cPVF463_.mjs → attachmentContent-B2os4HbA.mjs} +2 -2
- package/dist/{attachmentContent-kJKXpkMX.cjs → attachmentContent-Bo0UAsSu.cjs} +4 -4
- package/dist/{auth-BmESeKuM.mjs → auth-BS6PaOOG.mjs} +6 -6
- package/dist/{auth-CTECt2Oz.cjs → auth-D6bBUwZa.cjs} +6 -6
- package/dist/{auth-CKdXb9zp.mjs → auth-DMX0xPNK.mjs} +9 -9
- package/dist/{auth-DNxVmVbn.cjs → auth-HEhRaNgL.cjs} +9 -9
- package/dist/{authRelay-DSAvg1uv.mjs → authRelay-DhQhkBvX.mjs} +1 -1
- package/dist/{authRelay-BdYkC1Po.cjs → authRelay-Dy1qU9td.cjs} +1 -0
- package/dist/{auto-D1ypjjfx.cjs → auto-C6I55iOh.cjs} +19 -18
- package/dist/{auto-Ch3203qd.mjs → auto-Cl1SEDcD.mjs} +19 -18
- package/dist/{bootstrap-6OI698q9.cjs → bootstrap-exVucYav.cjs} +2 -2
- package/dist/{bootstrap-C0s2bPFQ.mjs → bootstrap-iuyufnp3.mjs} +2 -2
- package/dist/{browser-DG6Uof5O.cjs → browser-BohJK12g.cjs} +1 -1
- package/dist/{browser-BlLWZUMx.mjs → browser-CSYum7xH.mjs} +1 -1
- package/dist/{claudeLocal-CcWcKnoo.mjs → claudeLocal-Dq_R3Ax_.mjs} +6 -5
- package/dist/{claudeLocal-CemsIArT.cjs → claudeLocal-re4yjSTx.cjs} +6 -5
- package/dist/{claudeLocalLauncher-A4VuevIi.cjs → claudeLocalLauncher-B4hJHpCA.cjs} +11 -10
- package/dist/{claudeLocalLauncher-7p6y88nj.mjs → claudeLocalLauncher-CN67lN7-.mjs} +11 -10
- package/dist/{claudeSessionFork-BtROOjqf.mjs → claudeSessionFork-BihfD0Ik.mjs} +1 -1
- package/dist/{claudeSessionFork-CbDfm8Fz.cjs → claudeSessionFork-DiSMYerV.cjs} +1 -1
- package/dist/{client-DyvBTYee.cjs → client-BKcK1Bi-.cjs} +3 -3
- package/dist/client-BhoEBnuN.mjs +71 -0
- package/dist/{client-COmgDDy0.cjs → client-CuVdN6PP.cjs} +2 -2
- package/dist/{client-BPMWutfs.mjs → client-DuTDwWSQ.mjs} +3 -3
- package/dist/client-ZjOsn6nZ.cjs +76 -0
- package/dist/{client-DG5ndWLw.mjs → client-wo9nbxuf.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +25 -16
- package/dist/codex/happyMcpStdioBridge.mjs +25 -16
- package/dist/{codexAppServerClient-D-Z8qSfI.mjs → codexAppServerClient-BK3zra_1.mjs} +3 -3
- package/dist/{codexAppServerClient-R24WZZfg.cjs → codexAppServerClient-Dt5zxrun.cjs} +3 -3
- package/dist/{codexCommand-CVTkZJ1o.mjs → codexCommand-B6pY7CMh.mjs} +66 -61
- package/dist/{codexCommand-6hW19gsq.cjs → codexCommand-CAZ1SLjg.cjs} +89 -84
- package/dist/{codexTermination-CCIfwzcx.mjs → codexTermination-Cd1Eon_4.mjs} +1 -1
- package/dist/{codexTermination-BBU7e92y.cjs → codexTermination-DmGbHxcD.cjs} +1 -1
- package/dist/{config-CvsNChKX.mjs → config-2oMG_fEI.mjs} +3 -3
- package/dist/{config-DhdrvOLV.cjs → config-B0uK6K7n.cjs} +3 -3
- package/dist/{configuration-DZPy0T9Z.cjs → configuration-CMHZnp6G.cjs} +1 -1
- package/dist/{configuration-D55F0t16.mjs → configuration-WMi4idBB.mjs} +1 -1
- package/dist/{connect-CwCXMRmD.mjs → connect-BLVHhHzA.mjs} +15 -15
- package/dist/{connect-Wz-XZYXW.cjs → connect-uaglGrde.cjs} +15 -15
- package/dist/{context-BKbrZ55r.cjs → context-DXzU5bFM.cjs} +1 -1
- package/dist/{context-CCRpVXFo.mjs → context-DploEcoN.mjs} +1 -1
- package/dist/{controlClient-C4xB5J6O.mjs → controlClient-BWUJrj3t.mjs} +3 -3
- package/dist/{controlClient-SX8gSza2.cjs → controlClient-C-5qCt8W.cjs} +3 -3
- package/dist/{createSessionMetadata-Bi-m0Y_O.mjs → createSessionMetadata-3uXrJgOW.mjs} +2 -2
- package/dist/{createSessionMetadata-BCFmYlBo.cjs → createSessionMetadata-BkIzHALd.cjs} +2 -2
- package/dist/{defaultPermissionMode-wBcbBezm.mjs → defaultPermissionMode-BzxLh20a.mjs} +2 -2
- package/dist/{defaultPermissionMode-DMBEnXll.cjs → defaultPermissionMode-pS3vmiSg.cjs} +2 -2
- package/dist/{deterministicJson-ChGfQEF6.cjs → deterministicJson-B8z2GPi9.cjs} +220 -14
- package/dist/{deterministicJson-BkQETt8_.mjs → deterministicJson-D_whDMFd.mjs} +217 -12
- package/dist/{doctor-BsN3JZJn.cjs → doctor-Br1Kcy2J.cjs} +8 -8
- package/dist/{doctor-B9c2C9dF.mjs → doctor-CmtSsR2-.mjs} +8 -8
- package/dist/{downloadTarget-Dj3WoVJa.cjs → downloadTarget-BQJK_6oH.cjs} +6 -6
- package/dist/{downloadTarget-ByXzbDK4.mjs → downloadTarget-BoNwTIH_.mjs} +6 -6
- package/dist/{ensureDaemonRunning-7Wb8M7Lv.cjs → ensureDaemonRunning-BRUmsq6J.cjs} +5 -5
- package/dist/{ensureDaemonRunning--HYzs5Ce.mjs → ensureDaemonRunning-Czo9IHJQ.mjs} +5 -5
- package/dist/{handleResumeCommand-DHddBkNJ.mjs → handleResumeCommand-C8thKjqf.mjs} +22 -6
- package/dist/{handleResumeCommand-OmuUGYjQ.cjs → handleResumeCommand-tKD_Hpxc.cjs} +22 -6
- package/dist/{index-CrR4JISa.cjs → index-B0UjHlAe.cjs} +5 -5
- package/dist/{index-BzJNDsJq.mjs → index-BTxHphpV.mjs} +254 -49
- package/dist/index-BiyC7cZ3.mjs +18 -0
- package/dist/{index-De8L5lFK.cjs → index-C6O2vVjm.cjs} +156 -34
- package/dist/index-CUuc6iCn.cjs +24 -0
- package/dist/{index-Dhl6_bw7.mjs → index-CdQI0C9p.mjs} +5 -5
- package/dist/{index-D9NoYc5I.cjs → index-D09T1m8Y.cjs} +3 -3
- package/dist/{index-CEm0MYiS.mjs → index-D3bidoG8.mjs} +3 -3
- package/dist/{index-BRJzH4sc.cjs → index-DMqDMT1Q.cjs} +257 -52
- package/dist/{index-DMy3OCBe.mjs → index-DPOa4NhL.mjs} +154 -35
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-BdvKiOQw.mjs → install-BX3lv3NO.mjs} +1 -1
- package/dist/{install-Cf6AFSWC.cjs → install-BXvf2E3o.cjs} +1 -1
- package/dist/{install-1qn-D9FS.cjs → install-CYRZxS87.cjs} +3 -3
- package/dist/{install-BDIUtPXi.mjs → install-hnve_9vq.mjs} +3 -3
- package/dist/lib.cjs +14 -14
- package/dist/lib.d.cts +65 -1
- package/dist/lib.d.mts +65 -1
- package/dist/lib.mjs +14 -14
- package/dist/{lidState-BqVsw7H1.mjs → lidState-Bb8fgXg3.mjs} +2 -2
- package/dist/{lidState-DxbK0qfu.cjs → lidState-Dv2wwFTj.cjs} +2 -2
- package/dist/{localHappyAgentAuth-D5tANdRD.cjs → localHappyAgentAuth-DjYvkXvV.cjs} +2 -2
- package/dist/{localHappyAgentAuth-Ce8kO2yc.mjs → localHappyAgentAuth-NEU7fax7.mjs} +2 -2
- package/dist/{logger-13cBr_ew.mjs → logger-BtVhHnD8.mjs} +2 -2
- package/dist/{logger-LvwVeATU.cjs → logger-C1GWx3gi.cjs} +2 -2
- package/dist/{machineMetadata-29h7vgf4.cjs → machineMetadata-CLHS9sv_.cjs} +3 -3
- package/dist/{machineMetadata-dMida2qq.mjs → machineMetadata-D-g--oU_.mjs} +3 -3
- package/dist/{main-x4nAhdH5.mjs → main-B2LWV8DI.mjs} +59 -46
- package/dist/{main-DpM5jaFH.cjs → main-CWhSsbtU.cjs} +59 -46
- package/dist/{mcp-DQv3caXs.cjs → mcp-CARUsXHV.cjs} +15 -15
- package/dist/{mcp-DMiFGYMT.mjs → mcp-ext92q3Y.mjs} +15 -15
- package/dist/{mirrorProtocol-Bz8tEabR.mjs → mirrorProtocol-BwYibqry.mjs} +3 -3
- package/dist/{mirrorProtocol-BfrERW7Z.cjs → mirrorProtocol-DEy2g1CB.cjs} +3 -3
- package/dist/{package-CjlsAaRe.mjs → package-BPPebGQF.mjs} +7 -7
- package/dist/{package-Ch9WGDV_.cjs → package-SgqTYsjn.cjs} +7 -7
- package/dist/panels-BZ0_Tt7B.mjs +137 -0
- package/dist/panels-D1c7q2dD.cjs +142 -0
- package/dist/{peerTools-CxmrKnfV.mjs → peerTools-CWKzcQ7u.mjs} +60 -10
- package/dist/{peerTools-DtGKWli5.cjs → peerTools-DRQETXaz.cjs} +60 -9
- package/dist/{persistence-DXbKOHxl.cjs → persistence-BegE7NPa.cjs} +14 -3
- package/dist/{persistence-C_tYtOqK.mjs → persistence-Cr-wutZ4.mjs} +14 -4
- package/dist/{piRunnerArgs-BVRZe2AR.cjs → piRunnerArgs-Cs-378Vz.cjs} +8 -2
- package/dist/{piRunnerArgs-BpHc-JZl.mjs → piRunnerArgs-DwvM_yWA.mjs} +7 -1
- package/dist/{piRuntime-D7eio8Ix.cjs → piRuntime-BG-1td_n.cjs} +2 -2
- package/dist/{piRuntime-DOdGF395.mjs → piRuntime-Bue5mnlc.mjs} +2 -2
- package/dist/{piTerminal-dpxz4Q8D.mjs → piTerminal-B5x9X5yV.mjs} +18 -18
- package/dist/{piTerminal-y_PRo2NY.cjs → piTerminal-G4z-xVyy.cjs} +18 -18
- package/dist/processTreeSnapshot-CuLJDNC-.mjs +101 -0
- package/dist/processTreeSnapshot-mDbnuojn.cjs +105 -0
- package/dist/prompt-BOouDaTM.mjs +99 -0
- package/dist/prompt-lgF9IE82.cjs +105 -0
- package/dist/{attachmentLimits-Di1Z93lN.mjs → pushNotifications-BdFjDjQe.mjs} +303 -3
- package/dist/{attachmentLimits-DtFqqiwR.cjs → pushNotifications-DaLQUyi0.cjs} +304 -2
- package/dist/{index-DFPT4HOO.cjs → query-Ctfg-5gy.cjs} +25 -5
- package/dist/{index-CEjJnq05.mjs → query-DYP_W1wp.mjs} +26 -3
- package/dist/{rateLimitWindows-DYHDGuzQ.mjs → rateLimitWindows-CuEqk_0g.mjs} +1 -1
- package/dist/{rateLimitWindows-DFnMU2Vt.cjs → rateLimitWindows-Dj_8voBK.cjs} +1 -1
- package/dist/{registerCommonHandlers-D8OMpBbQ.mjs → registerCommonHandlers-BAlP7SGc.mjs} +2 -2
- package/dist/{registerCommonHandlers-60VuTkdg.cjs → registerCommonHandlers-Cj084Sg7.cjs} +2 -2
- package/dist/{registerKillSessionHandler-Drhf7-Vz.mjs → registerKillSessionHandler-PD0jWtQo.mjs} +6 -6
- package/dist/{registerKillSessionHandler-pqChBKwO.cjs → registerKillSessionHandler-qMju0ZfF.cjs} +6 -6
- package/dist/{remoteSessionClient-B7NvjHD3.cjs → remoteSessionClient-B7i7MkYV.cjs} +5 -5
- package/dist/{remoteSessionClient-D01Hso2-.mjs → remoteSessionClient-Bn2qu5C5.mjs} +5 -5
- package/dist/{reportProgressTool-Du_zAK4h.cjs → reportProgressTool-CM1JFAHg.cjs} +84 -2
- package/dist/{reportProgressTool-B203EZCR.mjs → reportProgressTool-gHItlSzz.mjs} +82 -3
- package/dist/{resources-JDPugcDq.cjs → resources-CvIlkzpP.cjs} +30 -0
- package/dist/{resources-BdFBQi8r.mjs → resources-y9jfyO-_.mjs} +30 -0
- package/dist/{run-DX4Zs3Ug.mjs → run-BM4TxiyN.mjs} +249 -45
- package/dist/{run-DZ5jU53c.cjs → run-CNXwIe0A.cjs} +263 -59
- package/dist/{runClaude-ClRhHpwR.cjs → runClaude-CWhj2V4Q.cjs} +37 -41
- package/dist/{runClaude-CgPHXP0L.mjs → runClaude-C_3I8hvR.mjs} +37 -41
- package/dist/{runClaudeDeps-D2v_WDSL.cjs → runClaudeDeps-B81cOKnH.cjs} +295 -157
- package/dist/{runClaudeDeps-Dz2iydq4.mjs → runClaudeDeps-QGrOeDe2.mjs} +295 -160
- package/dist/{runGemini-DBXxpoY8.mjs → runGemini-BEdWEZLR.mjs} +61 -55
- package/dist/{runGemini-BtZqGFkp.cjs → runGemini-CgRLYbt5.cjs} +61 -55
- package/dist/{runOpenClaw-D8q8G57u.cjs → runOpenClaw-C1NVmzOL.cjs} +19 -19
- package/dist/{runOpenClaw-BOHpzCEU.mjs → runOpenClaw-DdQZAYj1.mjs} +19 -19
- package/dist/{sandbox-C452Vrsc.mjs → sandbox-DjQUdCMG.mjs} +5 -5
- package/dist/{sandbox-Cu9mMzjx.cjs → sandbox-nocIjliq.cjs} +5 -5
- package/dist/selfCheck-CjCF4C3v.mjs +85 -0
- package/dist/{selfCheck-gKa3uVr1.cjs → selfCheck-DCt4Uzbq.cjs} +36 -35
- package/dist/{send-B8HARi7x.mjs → send-Ct7X4pPU.mjs} +9 -9
- package/dist/{send-2Vb5eppI.cjs → send-Dydf_hwZ.cjs} +9 -9
- package/dist/{server-Db9Wuam3.cjs → server-CosABFbd.cjs} +7 -7
- package/dist/{server-BBWCIZyS.mjs → server-DTQGZMxh.mjs} +5 -5
- package/dist/{sessionLock-6qL_N6Rn.cjs → sessionLock-DokGab2R.cjs} +16 -3
- package/dist/{sessionLock-ZfvFVdUi.mjs → sessionLock-WYIyaVO4.mjs} +16 -4
- package/dist/{sessionOps-CdgbEJgf.mjs → sessionOps-BIGgRube.mjs} +11 -6
- package/dist/{sessionOps-Dmt7WUUs.cjs → sessionOps-S-qPBLFf.cjs} +11 -6
- package/dist/{sessionScanner-CQL_WSaC.cjs → sessionScanner-CIMM2hvZ.cjs} +3 -3
- package/dist/{sessionScanner-CNVaSNOn.mjs → sessionScanner-o5hnMi5e.mjs} +3 -3
- package/dist/{sessions-DTomHfFg.mjs → sessions-BJHEZpi2.mjs} +40 -18
- package/dist/{sessions-BJblG_Hx.cjs → sessions-JchI1w3z.cjs} +40 -17
- package/dist/{setupOfflineReconnection-DVA0VpQL.cjs → setupOfflineReconnection-CNiAt5ZP.cjs} +2 -2
- package/dist/{setupOfflineReconnection-C5trsV-j.mjs → setupOfflineReconnection-DMiBO2y9.mjs} +2 -2
- package/dist/{spawn-DRyNAqD8.cjs → spawn-6PD7nnoC.cjs} +49 -18
- package/dist/{spawn-CQJFgoOq.mjs → spawn-DgvUNYEo.mjs} +49 -18
- package/dist/{spawnAgents-CCjJifAW.cjs → spawnAgents-DsXgegHM.cjs} +37 -1
- package/dist/spawnAgents-P006Hqio.mjs +79 -0
- package/dist/{spawnHappyCLI-B_0RWxD4.mjs → spawnHappyCLI-CCOrEtf9.mjs} +1 -1
- package/dist/{spawnHappyCLI-ChniczJ5.cjs → spawnHappyCLI-Dywezwk6.cjs} +1 -1
- package/dist/{specialCommands-DkdFJi4N.mjs → specialCommands-DPcd9edP.mjs} +3 -3
- package/dist/{specialCommands-DbntVs0d.cjs → specialCommands-QxPpkGKf.cjs} +3 -3
- package/dist/{startFileWatcher-UQyTSRAP.mjs → startFileWatcher-DghDOCO4.mjs} +1 -1
- package/dist/{startFileWatcher-C292fhra.cjs → startFileWatcher-RECH5qY8.cjs} +1 -1
- package/dist/{streamRelay-_qCd873P.mjs → streamRelay-DMV_TXfS.mjs} +1 -1
- package/dist/{streamRelay-Cx01enfe.cjs → streamRelay-DlUWKUpo.cjs} +1 -1
- package/dist/{sync-C3p7-KLn.mjs → sync-CSe0Rf45.mjs} +1 -1
- package/dist/{sync-C7sxoUYG.cjs → sync-D23jbqVa.cjs} +1 -1
- package/dist/{systemPrompt-DtibzbRU.cjs → systemPrompt-BOy4kU4P.cjs} +4 -3
- package/dist/{systemPrompt-CdHOlyVW.mjs → systemPrompt-CFNKnh65.mjs} +4 -3
- package/dist/{teams-ujXr3AFn.mjs → teams-DyY669f0.mjs} +9 -9
- package/dist/{teams-D7O7TpVU.cjs → teams-Ov2BDT-A.cjs} +9 -9
- package/dist/{time-yEL6wHUF.mjs → time-65DcU6Jx.mjs} +1 -1
- package/dist/{time-Dg5tVB8S.cjs → time-CrwIMHta.cjs} +1 -1
- package/dist/{titleGenerator-BMEaDTwU.cjs → titleGenerator-CS_rh2_J.cjs} +9 -8
- package/dist/{titleGenerator-Dr-BtjzO.mjs → titleGenerator-CiAMxf7s.mjs} +9 -8
- package/dist/{todo-CvJe4M2C.mjs → todo-BDONw0sK.mjs} +7 -7
- package/dist/{todo-CUcFamGs.cjs → todo-KY-okGii.cjs} +7 -7
- package/dist/{tools-BrM3bZW5.mjs → tools-D8-PnZEG.mjs} +1 -1
- package/dist/{tools-DDKTB5aQ.cjs → tools-_w52DZG6.cjs} +1 -1
- package/dist/{uninstall-7oLuhYIu.cjs → uninstall-8vnLN-IE.cjs} +3 -3
- package/dist/{uninstall-CEcMMQGz.mjs → uninstall-_fjGRP9b.mjs} +3 -3
- package/dist/webPanels-B2_C2-3g.mjs +49 -0
- package/dist/webPanels-FCgFKvVe.cjs +53 -0
- package/package.json +7 -7
- package/dist/selfCheck-BAvqBwBR.mjs +0 -84
- package/dist/sessionModeFile-CWVq8AT9.mjs +0 -32
- package/dist/sessionModeFile-CsLtn_PL.cjs +0 -36
- package/dist/spawnAgents-BjtmjBvP.mjs +0 -45
|
@@ -1,86 +1,90 @@
|
|
|
1
|
-
import { l as logger } from './logger-
|
|
2
|
-
import { q as notifyDaemonSessionEvent, t as notifyDaemonClaudeAuthFailed } from './controlClient-
|
|
3
|
-
export { j as reportSessionEditToDaemon } from './controlClient-
|
|
1
|
+
import { l as logger } from './logger-BtVhHnD8.mjs';
|
|
2
|
+
import { q as notifyDaemonSessionEvent, t as notifyDaemonClaudeAuthFailed } from './controlClient-BWUJrj3t.mjs';
|
|
3
|
+
export { j as reportSessionEditToDaemon } from './controlClient-BWUJrj3t.mjs';
|
|
4
4
|
import { s as sameBackgroundTasks, e as createBackgroundTaskTracker } from './backgroundTaskActivity-BVwJBl02.mjs';
|
|
5
|
+
import { c as createProjectInjector, h as hashObject } from './deterministicJson-D_whDMFd.mjs';
|
|
6
|
+
export { s as startHappyServer } from './deterministicJson-D_whDMFd.mjs';
|
|
7
|
+
import { s as sharedProjectsClient } from './client-BhoEBnuN.mjs';
|
|
5
8
|
import { randomInt, randomUUID, createHash } from 'node:crypto';
|
|
6
9
|
import { M as MessageBuffer } from './messageBuffer-BWlGgR3A.mjs';
|
|
7
|
-
import { query } from './
|
|
10
|
+
import { q as query } from './query-DYP_W1wp.mjs';
|
|
8
11
|
import { AbortError } from '@anthropic-ai/claude-agent-sdk';
|
|
9
12
|
import { m as mapToClaudeMode, p as parseClaudePermissionMode, c as resolveRemoteClaudePermissionMode } from './permissionMode-CH4FoZfU.mjs';
|
|
10
|
-
import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-
|
|
13
|
+
import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-CFNKnh65.mjs';
|
|
11
14
|
import { join, resolve, dirname } from 'node:path';
|
|
12
|
-
import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-
|
|
15
|
+
import { p as parseSpecialCommand, w as wrapperRateLimitReporter } from './specialCommands-DPcd9edP.mjs';
|
|
13
16
|
import 'axios';
|
|
14
17
|
import 'node:events';
|
|
15
18
|
import 'socket.io-client';
|
|
16
|
-
import { A as AsyncLock } from './
|
|
19
|
+
import { A as AsyncLock } from './pushNotifications-BdFjDjQe.mjs';
|
|
17
20
|
import 'tweetnacl';
|
|
18
|
-
import { c as configuration, e as ensurePrivateDirectory } from './configuration-
|
|
19
|
-
import './index-
|
|
20
|
-
import './registerCommonHandlers-
|
|
21
|
+
import { c as configuration, e as ensurePrivateDirectory } from './configuration-WMi4idBB.mjs';
|
|
22
|
+
import './index-DPOa4NhL.mjs';
|
|
23
|
+
import './registerCommonHandlers-BAlP7SGc.mjs';
|
|
21
24
|
import 'os';
|
|
22
25
|
import 'child_process';
|
|
23
26
|
import '@paralleldrive/cuid2';
|
|
24
|
-
import './persistence-
|
|
27
|
+
import './persistence-Cr-wutZ4.mjs';
|
|
25
28
|
import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
26
29
|
import 'chalk';
|
|
27
|
-
|
|
30
|
+
import { R as RawJSONLinesSchema } from './types-CkqAACXx.mjs';
|
|
28
31
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
29
32
|
import { access } from 'fs/promises';
|
|
30
|
-
import { d as delay } from './time-
|
|
33
|
+
import { d as delay } from './time-65DcU6Jx.mjs';
|
|
31
34
|
import { mkdirSync, writeFileSync, readFileSync, unlinkSync, renameSync, statSync, existsSync } from 'node:fs';
|
|
32
|
-
import {
|
|
33
|
-
export {
|
|
34
|
-
import { F as Future, d as describeClaudeProcessExit } from './sessionScanner-CNVaSNOn.mjs';
|
|
35
|
-
export { c as createSessionScanner } from './sessionScanner-CNVaSNOn.mjs';
|
|
35
|
+
import { F as Future, d as describeClaudeProcessExit } from './sessionScanner-o5hnMi5e.mjs';
|
|
36
|
+
export { c as createSessionScanner } from './sessionScanner-o5hnMi5e.mjs';
|
|
36
37
|
import { execSync } from 'node:child_process';
|
|
37
|
-
import { S as StreamRelay } from './streamRelay-
|
|
38
|
-
import { C as CLAUDE_ATTACHMENT_KINDS, c as chatAttachmentDirectory, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-
|
|
38
|
+
import { S as StreamRelay } from './streamRelay-DMV_TXfS.mjs';
|
|
39
|
+
import { C as CLAUDE_ATTACHMENT_KINDS, c as chatAttachmentDirectory, a as stageClaudeAttachments, b as appendStagedAttachmentsToPrompt } from './attachmentContent-B2os4HbA.mjs';
|
|
39
40
|
import { writeFile, rename, unlink, readFile } from 'node:fs/promises';
|
|
40
|
-
import { F as ForkSourceMissingError } from './claudeSessionFork-
|
|
41
|
-
export { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-
|
|
42
|
-
export { a as getEnvironmentInfo } from './doctor-
|
|
41
|
+
import { F as ForkSourceMissingError } from './claudeSessionFork-BihfD0Ik.mjs';
|
|
42
|
+
export { M as MessageQueue2, r as registerKillSessionHandler } from './registerKillSessionHandler-PD0jWtQo.mjs';
|
|
43
|
+
export { a as getEnvironmentInfo } from './doctor-CmtSsR2-.mjs';
|
|
43
44
|
import { createServer } from 'node:http';
|
|
44
45
|
export { E as EditReportThrottle, b as extractClaudeEditPaths } from './editPaths-BVfS_FFL.mjs';
|
|
45
46
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
export { s as snapshotTree, t as terminateSurvivors } from './processTreeSnapshot-CuLJDNC-.mjs';
|
|
48
|
+
import { r as resolveClaudeBinary, a as runClaudeOneShot } from './titleGenerator-CiAMxf7s.mjs';
|
|
49
|
+
export { T as TitleGenerator } from './titleGenerator-CiAMxf7s.mjs';
|
|
48
50
|
import { B as BOARD_ANALYZER_PROMPT_PREFIX } from './oneShotPrompts-DT4p6RNd.mjs';
|
|
49
|
-
import { i as isSelfReportFresh } from './reportProgressTool-
|
|
50
|
-
export { c as createSelfReportState } from './reportProgressTool-
|
|
51
|
+
import { i as isSelfReportFresh } from './reportProgressTool-gHItlSzz.mjs';
|
|
52
|
+
export { c as createSelfReportState } from './reportProgressTool-gHItlSzz.mjs';
|
|
51
53
|
import 'node:util';
|
|
52
|
-
import './
|
|
53
|
-
import './trimIdent-BAjmv_TG.mjs';
|
|
54
|
-
import 'node:os';
|
|
55
|
-
import './agentGuidance-BDYt2Qy2.mjs';
|
|
56
|
-
import './rateLimitWindows-DYHDGuzQ.mjs';
|
|
54
|
+
import './prompt-BOouDaTM.mjs';
|
|
57
55
|
import 'zod';
|
|
58
|
-
import './
|
|
59
|
-
import '
|
|
60
|
-
import '
|
|
61
|
-
import '
|
|
62
|
-
import '
|
|
63
|
-
import './
|
|
64
|
-
import './
|
|
65
|
-
import '
|
|
66
|
-
import './sessionOps-CdgbEJgf.mjs';
|
|
67
|
-
import './resources-BdFBQi8r.mjs';
|
|
68
|
-
import './tools-BrM3bZW5.mjs';
|
|
69
|
-
import './peerTools-CxmrKnfV.mjs';
|
|
56
|
+
import './client-DuTDwWSQ.mjs';
|
|
57
|
+
import './context-DploEcoN.mjs';
|
|
58
|
+
import './sessionOps-BIGgRube.mjs';
|
|
59
|
+
import './authRelay-DhQhkBvX.mjs';
|
|
60
|
+
import './resources-y9jfyO-_.mjs';
|
|
61
|
+
import './tools-D8-PnZEG.mjs';
|
|
62
|
+
import './peerTools-CWKzcQ7u.mjs';
|
|
63
|
+
import 'node:os';
|
|
70
64
|
import './ids-DU6sLx4C.mjs';
|
|
71
|
-
import './remoteSessionClient-
|
|
65
|
+
import './remoteSessionClient-Bn2qu5C5.mjs';
|
|
72
66
|
import '@modelcontextprotocol/sdk/server/mcp.js';
|
|
73
67
|
import '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
74
68
|
import './limits-DIo7rEBR.mjs';
|
|
75
|
-
import './downloadTarget-
|
|
69
|
+
import './downloadTarget-BoNwTIH_.mjs';
|
|
76
70
|
import './terminals-Dlg0x3nY.mjs';
|
|
77
71
|
import './terminalTitleSuggest-CeKsX_V6.mjs';
|
|
78
72
|
import './tmuxSocket-B8Yx20sT.mjs';
|
|
79
|
-
import './bootstrap-
|
|
73
|
+
import './bootstrap-iuyufnp3.mjs';
|
|
74
|
+
import './package-BPPebGQF.mjs';
|
|
75
|
+
import './agentGuidance-BDYt2Qy2.mjs';
|
|
76
|
+
import './trimIdent-BAjmv_TG.mjs';
|
|
77
|
+
import './webPanels-B2_C2-3g.mjs';
|
|
80
78
|
import './previewPath-CXN4Vag0.mjs';
|
|
81
|
-
import '
|
|
79
|
+
import 'crypto';
|
|
80
|
+
import './smallFastModel-BLNgMrwR.mjs';
|
|
81
|
+
import './rateLimitWindows-CuEqk_0g.mjs';
|
|
82
|
+
import 'util';
|
|
83
|
+
import 'path';
|
|
84
|
+
import 'cross-spawn';
|
|
85
|
+
import './sync-CSe0Rf45.mjs';
|
|
82
86
|
import './transcriptCursor-B7T_gkQ0.mjs';
|
|
83
|
-
import './startFileWatcher-
|
|
87
|
+
import './startFileWatcher-DghDOCO4.mjs';
|
|
84
88
|
import 'node:readline';
|
|
85
89
|
import './doctor-BPkYWSuq.mjs';
|
|
86
90
|
import 'ps-list';
|
|
@@ -88,11 +92,11 @@ import './doctorReadiness-C208SMN9.mjs';
|
|
|
88
92
|
import './detectCLI-CSGMlV51.mjs';
|
|
89
93
|
import 'fs';
|
|
90
94
|
import './cliUpdate-Y34VGe9Y.mjs';
|
|
91
|
-
import './piRunnerArgs-
|
|
92
|
-
import './
|
|
95
|
+
import './piRunnerArgs-DwvM_yWA.mjs';
|
|
96
|
+
import './acpSessionResume-DTGmAPLt.mjs';
|
|
93
97
|
import 'url';
|
|
94
98
|
import 'node:module';
|
|
95
|
-
import './client-
|
|
99
|
+
import './client-wo9nbxuf.mjs';
|
|
96
100
|
import './precheckCompat-DeEbilbr.mjs';
|
|
97
101
|
|
|
98
102
|
const SCHEDULE_WAKEUP_GRACE_MS = 6e4;
|
|
@@ -130,6 +134,41 @@ function createScheduledWakeupTracker() {
|
|
|
130
134
|
return { observe, pending };
|
|
131
135
|
}
|
|
132
136
|
|
|
137
|
+
function modelTarget(model) {
|
|
138
|
+
return model == null || model === "" ? void 0 : model;
|
|
139
|
+
}
|
|
140
|
+
function needsModelSwitch(current, next) {
|
|
141
|
+
return modelTarget(current) !== modelTarget(next);
|
|
142
|
+
}
|
|
143
|
+
function modelSwitchFailureNotice(model, error) {
|
|
144
|
+
const name = modelTarget(model) ?? "default";
|
|
145
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
146
|
+
return `\u26A0\uFE0F Could not switch to model "${name}" \u2014 continuing with the previous model. ${detail}`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const CLAUDE_MODEL_NOT_FOUND = "model_not_found";
|
|
150
|
+
function retiredModelFrom(message, runningModel) {
|
|
151
|
+
const m = message;
|
|
152
|
+
if (!m || m.type !== "assistant" || m.error !== CLAUDE_MODEL_NOT_FOUND) return null;
|
|
153
|
+
if ((m.parent_tool_use_id ?? null) !== null) return null;
|
|
154
|
+
return modelTarget(runningModel) ?? null;
|
|
155
|
+
}
|
|
156
|
+
function createRetiredModels() {
|
|
157
|
+
const retired = /* @__PURE__ */ new Set();
|
|
158
|
+
return {
|
|
159
|
+
retire(model) {
|
|
160
|
+
retired.add(model);
|
|
161
|
+
},
|
|
162
|
+
effective(model) {
|
|
163
|
+
const target = modelTarget(model);
|
|
164
|
+
return target !== void 0 && retired.has(target) ? void 0 : target;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function retiredModelNotice(model) {
|
|
169
|
+
return `\u26A0\uFE0F Model "${model}" is no longer available \u2014 switched this session to the default model. Pick another model to change it, then send your message again.`;
|
|
170
|
+
}
|
|
171
|
+
|
|
133
172
|
class Session {
|
|
134
173
|
path;
|
|
135
174
|
logPath;
|
|
@@ -158,6 +197,8 @@ class Session {
|
|
|
158
197
|
backgroundTasks = [];
|
|
159
198
|
/** B-587 review P3-4: CronCreate / ScheduleWakeup pending in this Claude process. */
|
|
160
199
|
scheduledWakeups = createScheduledWakeupTracker();
|
|
200
|
+
/** B-634 ③: model ids Claude Code reported as model_not_found — session-scoped, survives relaunches. */
|
|
201
|
+
retiredModels = createRetiredModels();
|
|
161
202
|
/**
|
|
162
203
|
* Window after a user-initiated abort during which stray promise rejections
|
|
163
204
|
* from tearing down the SDK query (MCP transports, in-flight tool calls,
|
|
@@ -211,6 +252,20 @@ class Session {
|
|
|
211
252
|
sessionFoundCallbacks = [];
|
|
212
253
|
/** Keep alive interval reference for cleanup */
|
|
213
254
|
keepAliveInterval;
|
|
255
|
+
/**
|
|
256
|
+
* B-645: project context rides in front of real user messages (never the
|
|
257
|
+
* system prompt), so it survives relaunches without touching the mode hash
|
|
258
|
+
* or prewarm key. One per session process; created on first use.
|
|
259
|
+
*/
|
|
260
|
+
_projectInjector = null;
|
|
261
|
+
get projectInjector() {
|
|
262
|
+
return this._projectInjector ??= createProjectInjector({
|
|
263
|
+
client: sharedProjectsClient(),
|
|
264
|
+
sessionId: () => this.client.sessionId,
|
|
265
|
+
metadata: () => this.client.getMetadata?.() ?? null,
|
|
266
|
+
agent: "claude"
|
|
267
|
+
});
|
|
268
|
+
}
|
|
214
269
|
constructor(opts) {
|
|
215
270
|
this.path = opts.path;
|
|
216
271
|
this.api = opts.api;
|
|
@@ -597,6 +652,112 @@ function createRuntimeControls(isThinking) {
|
|
|
597
652
|
return { setQuery, observe, request, stopRunningTasks };
|
|
598
653
|
}
|
|
599
654
|
|
|
655
|
+
const CLAUDE_COMMAND_LIFECYCLE_STATES = ["queued", "started", "completed", "cancelled", "discarded", "refused"];
|
|
656
|
+
function readClaudeCommandLifecycle(frame) {
|
|
657
|
+
const m = frame;
|
|
658
|
+
if (!m) return null;
|
|
659
|
+
const isLifecycle = m.type === "command_lifecycle" || m.type === "system" && m.subtype === "command_lifecycle";
|
|
660
|
+
if (!isLifecycle || typeof m.command_uuid !== "string" || m.command_uuid.length === 0) return null;
|
|
661
|
+
const state = CLAUDE_COMMAND_LIFECYCLE_STATES.find((candidate) => candidate === m.state);
|
|
662
|
+
return state ? { uuid: m.command_uuid, state } : null;
|
|
663
|
+
}
|
|
664
|
+
const uuidList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
|
|
665
|
+
const INTERRUPT_CANCEL_QUEUED_CAPABILITY = "interrupt_cancel_queued_v1";
|
|
666
|
+
const PENDING_MAX = 256;
|
|
667
|
+
const REPORTED_MAX = 512;
|
|
668
|
+
const MSG_LIFECYCLE_CAPABILITY = "msg_lifecycle_v1";
|
|
669
|
+
function createClaudeCommandTracker() {
|
|
670
|
+
const pending = /* @__PURE__ */ new Map();
|
|
671
|
+
const reported = /* @__PURE__ */ new Set();
|
|
672
|
+
const drop = (uuid) => {
|
|
673
|
+
pending.delete(uuid);
|
|
674
|
+
if (reported.has(uuid)) return null;
|
|
675
|
+
reported.add(uuid);
|
|
676
|
+
if (reported.size > REPORTED_MAX) reported.delete(reported.values().next().value);
|
|
677
|
+
return uuid;
|
|
678
|
+
};
|
|
679
|
+
return {
|
|
680
|
+
/** A uuid-stamped user message (prompt or steer) was handed to the Query. */
|
|
681
|
+
track(uuid, payload) {
|
|
682
|
+
if (!pending.has(uuid) && pending.size >= PENDING_MAX) pending.delete(pending.keys().next().value);
|
|
683
|
+
pending.set(uuid, { started: false, payload });
|
|
684
|
+
},
|
|
685
|
+
isTracked(uuid) {
|
|
686
|
+
return pending.has(uuid);
|
|
687
|
+
},
|
|
688
|
+
/** A lifecycle frame; returns the uuids now known to have never run. */
|
|
689
|
+
observe(lifecycle) {
|
|
690
|
+
const entry = pending.get(lifecycle.uuid);
|
|
691
|
+
if (!entry) return [];
|
|
692
|
+
switch (lifecycle.state) {
|
|
693
|
+
case "queued":
|
|
694
|
+
return [];
|
|
695
|
+
case "started":
|
|
696
|
+
entry.started = true;
|
|
697
|
+
return [];
|
|
698
|
+
case "completed":
|
|
699
|
+
pending.delete(lifecycle.uuid);
|
|
700
|
+
return [];
|
|
701
|
+
default: {
|
|
702
|
+
if (entry.started) {
|
|
703
|
+
pending.delete(lifecycle.uuid);
|
|
704
|
+
return [];
|
|
705
|
+
}
|
|
706
|
+
const dropped = drop(lifecycle.uuid);
|
|
707
|
+
return dropped ? [dropped] : [];
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
/**
|
|
712
|
+
* An interrupt's receipt: `cancelled` members we track never ran;
|
|
713
|
+
* `still_queued` members we track are returned for the per-uuid
|
|
714
|
+
* follow-up (`cancel_async_message`) a CLI without cancel_queued needs.
|
|
715
|
+
*/
|
|
716
|
+
onInterruptReceipt(receipt) {
|
|
717
|
+
const dropped = [];
|
|
718
|
+
for (const uuid of uuidList(receipt?.cancelled)) {
|
|
719
|
+
if (!pending.has(uuid)) continue;
|
|
720
|
+
const result = drop(uuid);
|
|
721
|
+
if (result) dropped.push(result);
|
|
722
|
+
}
|
|
723
|
+
const stillQueued = uuidList(receipt?.still_queued).filter((uuid) => pending.has(uuid));
|
|
724
|
+
return { dropped, stillQueued };
|
|
725
|
+
},
|
|
726
|
+
/** The answer to `cancel_async_message`: true = withdrawn before it ran; false = already dequeued, its lifecycle frames follow. */
|
|
727
|
+
onCancelResponse(uuid, cancelled) {
|
|
728
|
+
if (!cancelled || !pending.has(uuid)) return [];
|
|
729
|
+
const dropped = drop(uuid);
|
|
730
|
+
return dropped ? [dropped] : [];
|
|
731
|
+
},
|
|
732
|
+
/**
|
|
733
|
+
* B-634 ②: the Query is over — every tracked message that never
|
|
734
|
+
* `started` and was not already reported, in the order it was sent.
|
|
735
|
+
* Untracked afterwards; a later frame for one of them is ignored.
|
|
736
|
+
*/
|
|
737
|
+
takeUnconfirmed() {
|
|
738
|
+
const out = [];
|
|
739
|
+
for (const [uuid, entry] of pending) {
|
|
740
|
+
if (entry.started || entry.payload === void 0 || reported.has(uuid)) continue;
|
|
741
|
+
out.push({ uuid, payload: entry.payload });
|
|
742
|
+
}
|
|
743
|
+
for (const { uuid } of out) pending.delete(uuid);
|
|
744
|
+
return out;
|
|
745
|
+
},
|
|
746
|
+
clear() {
|
|
747
|
+
pending.clear();
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
function planUnconfirmedCommands(commands, context) {
|
|
752
|
+
if (context.aborted || !context.parkFree) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
|
|
753
|
+
const index = commands.findIndex((c) => !context.redelivered.has(c.uuid));
|
|
754
|
+
if (index < 0) return { redeliver: null, tombstone: commands.map((c) => c.uuid) };
|
|
755
|
+
return {
|
|
756
|
+
redeliver: commands[index],
|
|
757
|
+
tombstone: commands.filter((_, i) => i !== index).map((c) => c.uuid)
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
|
|
600
761
|
const AUTH_FAILURE_RESULT_TEXT = /Failed to authenticate|OAuth session expired/i;
|
|
601
762
|
const QUERY_RECYCLE_NOTICE = {
|
|
602
763
|
authentication_failed: "\u26A0\uFE0F Claude Code could not refresh its OAuth session. This agent process was ended so your next message starts a fresh one that re-reads the credentials on this machine; if it fails again, run `claude` on the machine to log in again."
|
|
@@ -750,18 +911,6 @@ async function awaitFileExist(file, timeout = 1e4) {
|
|
|
750
911
|
return false;
|
|
751
912
|
}
|
|
752
913
|
|
|
753
|
-
function modelTarget(model) {
|
|
754
|
-
return model == null || model === "" ? void 0 : model;
|
|
755
|
-
}
|
|
756
|
-
function needsModelSwitch(current, next) {
|
|
757
|
-
return modelTarget(current) !== modelTarget(next);
|
|
758
|
-
}
|
|
759
|
-
function modelSwitchFailureNotice(model, error) {
|
|
760
|
-
const name = modelTarget(model) ?? "default";
|
|
761
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
762
|
-
return `\u26A0\uFE0F Could not switch to model "${name}" \u2014 continuing with the previous model. ${detail}`;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
914
|
const SDK_TIMING_FIELDS = ["ttft_ms", "time_to_request_ms", "time_to_request_from_spawn_ms"];
|
|
766
915
|
function delta(from, to) {
|
|
767
916
|
if (typeof from !== "number" || typeof to !== "number" || to < from) return "-";
|
|
@@ -1096,88 +1245,6 @@ function createClaudeTurnTracker() {
|
|
|
1096
1245
|
};
|
|
1097
1246
|
}
|
|
1098
1247
|
|
|
1099
|
-
const CLAUDE_COMMAND_LIFECYCLE_STATES = ["queued", "started", "completed", "cancelled", "discarded", "refused"];
|
|
1100
|
-
function readClaudeCommandLifecycle(frame) {
|
|
1101
|
-
const m = frame;
|
|
1102
|
-
if (!m) return null;
|
|
1103
|
-
const isLifecycle = m.type === "command_lifecycle" || m.type === "system" && m.subtype === "command_lifecycle";
|
|
1104
|
-
if (!isLifecycle || typeof m.command_uuid !== "string" || m.command_uuid.length === 0) return null;
|
|
1105
|
-
const state = CLAUDE_COMMAND_LIFECYCLE_STATES.find((candidate) => candidate === m.state);
|
|
1106
|
-
return state ? { uuid: m.command_uuid, state } : null;
|
|
1107
|
-
}
|
|
1108
|
-
const uuidList = (value) => Array.isArray(value) ? value.filter((item) => typeof item === "string" && item.length > 0) : [];
|
|
1109
|
-
const INTERRUPT_CANCEL_QUEUED_CAPABILITY = "interrupt_cancel_queued_v1";
|
|
1110
|
-
const PENDING_MAX = 256;
|
|
1111
|
-
const REPORTED_MAX = 512;
|
|
1112
|
-
function createClaudeCommandTracker() {
|
|
1113
|
-
const pending = /* @__PURE__ */ new Map();
|
|
1114
|
-
const reported = /* @__PURE__ */ new Set();
|
|
1115
|
-
const drop = (uuid) => {
|
|
1116
|
-
pending.delete(uuid);
|
|
1117
|
-
if (reported.has(uuid)) return null;
|
|
1118
|
-
reported.add(uuid);
|
|
1119
|
-
if (reported.size > REPORTED_MAX) reported.delete(reported.values().next().value);
|
|
1120
|
-
return uuid;
|
|
1121
|
-
};
|
|
1122
|
-
return {
|
|
1123
|
-
/** A uuid-stamped user message (prompt or steer) was handed to the Query. */
|
|
1124
|
-
track(uuid) {
|
|
1125
|
-
if (!pending.has(uuid) && pending.size >= PENDING_MAX) pending.delete(pending.keys().next().value);
|
|
1126
|
-
pending.set(uuid, { started: false });
|
|
1127
|
-
},
|
|
1128
|
-
isTracked(uuid) {
|
|
1129
|
-
return pending.has(uuid);
|
|
1130
|
-
},
|
|
1131
|
-
/** A lifecycle frame; returns the uuids now known to have never run. */
|
|
1132
|
-
observe(lifecycle) {
|
|
1133
|
-
const entry = pending.get(lifecycle.uuid);
|
|
1134
|
-
if (!entry) return [];
|
|
1135
|
-
switch (lifecycle.state) {
|
|
1136
|
-
case "queued":
|
|
1137
|
-
return [];
|
|
1138
|
-
case "started":
|
|
1139
|
-
entry.started = true;
|
|
1140
|
-
return [];
|
|
1141
|
-
case "completed":
|
|
1142
|
-
pending.delete(lifecycle.uuid);
|
|
1143
|
-
return [];
|
|
1144
|
-
default: {
|
|
1145
|
-
if (entry.started) {
|
|
1146
|
-
pending.delete(lifecycle.uuid);
|
|
1147
|
-
return [];
|
|
1148
|
-
}
|
|
1149
|
-
const dropped = drop(lifecycle.uuid);
|
|
1150
|
-
return dropped ? [dropped] : [];
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
},
|
|
1154
|
-
/**
|
|
1155
|
-
* An interrupt's receipt: `cancelled` members we track never ran;
|
|
1156
|
-
* `still_queued` members we track are returned for the per-uuid
|
|
1157
|
-
* follow-up (`cancel_async_message`) a CLI without cancel_queued needs.
|
|
1158
|
-
*/
|
|
1159
|
-
onInterruptReceipt(receipt) {
|
|
1160
|
-
const dropped = [];
|
|
1161
|
-
for (const uuid of uuidList(receipt?.cancelled)) {
|
|
1162
|
-
if (!pending.has(uuid)) continue;
|
|
1163
|
-
const result = drop(uuid);
|
|
1164
|
-
if (result) dropped.push(result);
|
|
1165
|
-
}
|
|
1166
|
-
const stillQueued = uuidList(receipt?.still_queued).filter((uuid) => pending.has(uuid));
|
|
1167
|
-
return { dropped, stillQueued };
|
|
1168
|
-
},
|
|
1169
|
-
/** The answer to `cancel_async_message`: true = withdrawn before it ran; false = already dequeued, its lifecycle frames follow. */
|
|
1170
|
-
onCancelResponse(uuid, cancelled) {
|
|
1171
|
-
if (!cancelled || !pending.has(uuid)) return [];
|
|
1172
|
-
const dropped = drop(uuid);
|
|
1173
|
-
return dropped ? [dropped] : [];
|
|
1174
|
-
},
|
|
1175
|
-
clear() {
|
|
1176
|
-
pending.clear();
|
|
1177
|
-
}
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
1248
|
const SET_MODEL_TIMEOUT_MS = 3e4;
|
|
1182
1249
|
const PROMPT_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1183
1250
|
function promptUuid(uuid) {
|
|
@@ -1351,9 +1418,14 @@ async function claudeRemote(opts) {
|
|
|
1351
1418
|
const discardWarm = (reason) => {
|
|
1352
1419
|
warm?.lease.discard(reason);
|
|
1353
1420
|
};
|
|
1421
|
+
const withoutRetiredModel = (next) => {
|
|
1422
|
+
if (!next || !opts.retiredModels) return next;
|
|
1423
|
+
const model = opts.retiredModels.effective(next.mode.model);
|
|
1424
|
+
return model === next.mode.model ? next : { ...next, mode: { ...next.mode, model } };
|
|
1425
|
+
};
|
|
1354
1426
|
let initial;
|
|
1355
1427
|
try {
|
|
1356
|
-
initial = await opts.nextMessage();
|
|
1428
|
+
initial = withoutRetiredModel(await opts.nextMessage());
|
|
1357
1429
|
} catch (error) {
|
|
1358
1430
|
discardWarm("error");
|
|
1359
1431
|
throw error;
|
|
@@ -1513,7 +1585,7 @@ async function claudeRemote(opts) {
|
|
|
1513
1585
|
steer: (message, nextMode, localKey) => {
|
|
1514
1586
|
mode = { ...nextMode, model: mode.model };
|
|
1515
1587
|
const uuid = promptUuid(localKey);
|
|
1516
|
-
if (uuid.uuid) commandTracker.track(uuid.uuid);
|
|
1588
|
+
if (uuid.uuid) commandTracker.track(uuid.uuid, { message, mode: nextMode });
|
|
1517
1589
|
messages.push({
|
|
1518
1590
|
type: "user",
|
|
1519
1591
|
parent_tool_use_id: null,
|
|
@@ -1527,7 +1599,7 @@ async function claudeRemote(opts) {
|
|
|
1527
1599
|
}
|
|
1528
1600
|
let lastAssistantError;
|
|
1529
1601
|
turn.pushed();
|
|
1530
|
-
if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid);
|
|
1602
|
+
if (initialUserMessage.uuid) commandTracker.track(initialUserMessage.uuid, { message: initial.message, mode: initial.mode });
|
|
1531
1603
|
let modelUnconfirmed = false;
|
|
1532
1604
|
let pullingNext = false;
|
|
1533
1605
|
const pullNextMessage = () => {
|
|
@@ -1536,8 +1608,10 @@ async function claudeRemote(opts) {
|
|
|
1536
1608
|
return;
|
|
1537
1609
|
}
|
|
1538
1610
|
pullingNext = true;
|
|
1539
|
-
opts.nextMessage().then(async (
|
|
1611
|
+
opts.nextMessage().then(async (pulled) => {
|
|
1612
|
+
let next = withoutRetiredModel(pulled);
|
|
1540
1613
|
if (!next) {
|
|
1614
|
+
pullingNext = false;
|
|
1541
1615
|
messages.end();
|
|
1542
1616
|
return;
|
|
1543
1617
|
}
|
|
@@ -1557,8 +1631,9 @@ async function claudeRemote(opts) {
|
|
|
1557
1631
|
updateThinking(true);
|
|
1558
1632
|
turn.pushed();
|
|
1559
1633
|
const uuid = promptUuid(next.uuid);
|
|
1560
|
-
if (uuid.uuid) commandTracker.track(uuid.uuid);
|
|
1634
|
+
if (uuid.uuid) commandTracker.track(uuid.uuid, { message: next.message, mode: next.mode });
|
|
1561
1635
|
timingMarks = { pushedAt: next.enqueuedAt ?? Date.now() };
|
|
1636
|
+
pullingNext = false;
|
|
1562
1637
|
messages.push({
|
|
1563
1638
|
type: "user",
|
|
1564
1639
|
parent_tool_use_id: null,
|
|
@@ -1567,9 +1642,8 @@ async function claudeRemote(opts) {
|
|
|
1567
1642
|
message: { role: "user", content: next.message }
|
|
1568
1643
|
});
|
|
1569
1644
|
}).catch(() => {
|
|
1570
|
-
messages.end();
|
|
1571
|
-
}).finally(() => {
|
|
1572
1645
|
pullingNext = false;
|
|
1646
|
+
messages.end();
|
|
1573
1647
|
});
|
|
1574
1648
|
};
|
|
1575
1649
|
const recycleIfPoisoned = (result) => {
|
|
@@ -1608,6 +1682,17 @@ async function claudeRemote(opts) {
|
|
|
1608
1682
|
if (message.type === "assistant" && message.error) {
|
|
1609
1683
|
lastAssistantError = message.error;
|
|
1610
1684
|
}
|
|
1685
|
+
const retired = opts.retiredModels ? retiredModelFrom(message, mode.model) : null;
|
|
1686
|
+
if (retired) {
|
|
1687
|
+
opts.retiredModels.retire(retired);
|
|
1688
|
+
mode = { ...mode, model: void 0 };
|
|
1689
|
+
logger.debug(`[claudeRemote] Model ${retired} reported model_not_found; moving the session to the default model`);
|
|
1690
|
+
opts.onCompletionEvent?.(retiredModelNotice(retired));
|
|
1691
|
+
void withTimeout(response.setModel(void 0), SET_MODEL_TIMEOUT_MS, "set_model").catch((e) => {
|
|
1692
|
+
logger.debug(`[claudeRemote] setModel(default) after model_not_found failed: ${e instanceof Error ? e.message : String(e)}`);
|
|
1693
|
+
modelUnconfirmed = true;
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1611
1696
|
if (message.type === "assistant" && timingMarks.firstAssistantAt === void 0) {
|
|
1612
1697
|
timingMarks.firstAssistantAt = Date.now();
|
|
1613
1698
|
} else if (message.type === "system" && message.subtype === "init" && timingMarks.initAt === void 0) {
|
|
@@ -1721,6 +1806,13 @@ async function claudeRemote(opts) {
|
|
|
1721
1806
|
}
|
|
1722
1807
|
} finally {
|
|
1723
1808
|
updateThinking(false);
|
|
1809
|
+
if (cliCapabilities.has(MSG_LIFECYCLE_CAPABILITY)) {
|
|
1810
|
+
const unconfirmed = commandTracker.takeUnconfirmed();
|
|
1811
|
+
if (unconfirmed.length > 0) {
|
|
1812
|
+
logger.debug(`[claudeRemote] Query ended with ${unconfirmed.length} user message(s) never started: ${unconfirmed.map((c) => c.uuid).join(", ")}`);
|
|
1813
|
+
opts.onCommandsUnconfirmed?.(unconfirmed, { aborted: opts.signal?.aborted === true });
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1724
1816
|
}
|
|
1725
1817
|
}
|
|
1726
1818
|
|
|
@@ -3952,6 +4044,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
3952
4044
|
}
|
|
3953
4045
|
try {
|
|
3954
4046
|
const modeGate = new LaunchModeGate(session.queue.modeHasher);
|
|
4047
|
+
const redeliveredCommands = /* @__PURE__ */ new Set();
|
|
3955
4048
|
let previousSessionId = null;
|
|
3956
4049
|
await Promise.race([
|
|
3957
4050
|
rewindReconciler.startup().catch((error) => logger.debug("[rewind] startup reconcile failed", error)),
|
|
@@ -4007,10 +4100,15 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
4007
4100
|
return permissionHandler.isAborted(toolCallId);
|
|
4008
4101
|
},
|
|
4009
4102
|
nextMessage: async () => {
|
|
4103
|
+
const finalize = async (text) => {
|
|
4104
|
+
const out = await session.projectInjector.decorate(text);
|
|
4105
|
+
onPromptFinalized?.(out);
|
|
4106
|
+
return out;
|
|
4107
|
+
};
|
|
4010
4108
|
const parked = modeGate.takeParked();
|
|
4011
4109
|
if (parked) {
|
|
4012
4110
|
permissionHandler.handleModeChange(parked.mode.permissionMode);
|
|
4013
|
-
if (typeof parked.message === "string")
|
|
4111
|
+
if (typeof parked.message === "string") return { ...parked, message: await finalize(parked.message) };
|
|
4014
4112
|
return parked;
|
|
4015
4113
|
}
|
|
4016
4114
|
await rewindReconciler.settled(controller.signal);
|
|
@@ -4039,8 +4137,7 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
4039
4137
|
sessionId: session.client.sessionId
|
|
4040
4138
|
});
|
|
4041
4139
|
logger.debug(`[remote] Staged ${staged.length} attachment(s) for the coding agent`);
|
|
4042
|
-
const withAttachments = appendStagedAttachmentsToPrompt(msg.message, staged);
|
|
4043
|
-
onPromptFinalized?.(withAttachments);
|
|
4140
|
+
const withAttachments = await finalize(appendStagedAttachmentsToPrompt(msg.message, staged));
|
|
4044
4141
|
return {
|
|
4045
4142
|
message: withAttachments,
|
|
4046
4143
|
mode: msg.mode,
|
|
@@ -4048,9 +4145,9 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
4048
4145
|
uuid: promptUuidFor(msg.sourceIds)
|
|
4049
4146
|
};
|
|
4050
4147
|
}
|
|
4051
|
-
|
|
4148
|
+
const finalized = await finalize(msg.message);
|
|
4052
4149
|
return {
|
|
4053
|
-
message:
|
|
4150
|
+
message: finalized,
|
|
4054
4151
|
mode: msg.mode,
|
|
4055
4152
|
enqueuedAt: msg.enqueuedAt,
|
|
4056
4153
|
uuid: promptUuidFor(msg.sourceIds)
|
|
@@ -4124,6 +4221,25 @@ async function claudeRemoteLauncher(session, onPermissionModeChange, onEffective
|
|
|
4124
4221
|
// queued behind a pre-empting steer's turn) before the model
|
|
4125
4222
|
// read them — the same tombstone a destroyed queue item gets
|
|
4126
4223
|
// (B-332), so the web shows them as not delivered, not answered.
|
|
4224
|
+
retiredModels: session.retiredModels,
|
|
4225
|
+
// B-634 ②: messages the Query ended without Claude Code ever
|
|
4226
|
+
// starting them — sent once more, or tombstoned (B-332).
|
|
4227
|
+
onCommandsUnconfirmed: (commands, { aborted }) => {
|
|
4228
|
+
const plan = planUnconfirmedCommands(commands, {
|
|
4229
|
+
aborted: aborted || exitReason !== null,
|
|
4230
|
+
parkFree: !modeGate.hasParked,
|
|
4231
|
+
redelivered: redeliveredCommands
|
|
4232
|
+
});
|
|
4233
|
+
if (plan.redeliver) {
|
|
4234
|
+
redeliveredCommands.add(plan.redeliver.uuid);
|
|
4235
|
+
logger.debug(`[remote]: re-sending unconfirmed user message ${plan.redeliver.uuid} into the next launch`);
|
|
4236
|
+
modeGate.park({ message: plan.redeliver.payload.message, mode: plan.redeliver.payload.mode, uuid: plan.redeliver.uuid });
|
|
4237
|
+
}
|
|
4238
|
+
if (plan.tombstone.length > 0) {
|
|
4239
|
+
logger.debug(`[remote]: ${plan.tombstone.length} user message(s) never started before the query ended`);
|
|
4240
|
+
session.client.sendQueueCancelReason(plan.tombstone, "aborted");
|
|
4241
|
+
}
|
|
4242
|
+
},
|
|
4127
4243
|
onCommandsDropped: (uuids) => {
|
|
4128
4244
|
logger.debug(`[remote]: ${uuids.length} user message(s) never read before the turn ended`);
|
|
4129
4245
|
session.client.sendQueueCancelReason(uuids, "aborted");
|
|
@@ -4266,7 +4382,7 @@ async function loop(opts) {
|
|
|
4266
4382
|
logger.debug(`[loop] Iteration with mode: ${mode}`);
|
|
4267
4383
|
switch (mode) {
|
|
4268
4384
|
case "local": {
|
|
4269
|
-
const { claudeLocalLauncher } = await import('./claudeLocalLauncher-
|
|
4385
|
+
const { claudeLocalLauncher } = await import('./claudeLocalLauncher-CN67lN7-.mjs');
|
|
4270
4386
|
const result = await claudeLocalLauncher(session);
|
|
4271
4387
|
switch (result.type) {
|
|
4272
4388
|
case "switch":
|
|
@@ -4672,7 +4788,7 @@ function registerSideQuestionHandler(rpc, deps) {
|
|
|
4672
4788
|
const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
|
|
4673
4789
|
const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
|
|
4674
4790
|
const fork = deps.run ?? (async (input) => {
|
|
4675
|
-
const { query } = await import('./index-
|
|
4791
|
+
const { query } = await import('./index-BiyC7cZ3.mjs');
|
|
4676
4792
|
return runSideQuestion(query, input);
|
|
4677
4793
|
});
|
|
4678
4794
|
const run = async (input, live) => {
|
|
@@ -4786,6 +4902,25 @@ function registerSideQuestionHandler(rpc, deps) {
|
|
|
4786
4902
|
};
|
|
4787
4903
|
}
|
|
4788
4904
|
|
|
4905
|
+
function replayClaudeForkJsonl(file, sink) {
|
|
4906
|
+
let replayed = 0;
|
|
4907
|
+
for (const line of file.split("\n")) {
|
|
4908
|
+
if (line.trim().length === 0) continue;
|
|
4909
|
+
let parsed;
|
|
4910
|
+
try {
|
|
4911
|
+
parsed = JSON.parse(line);
|
|
4912
|
+
} catch {
|
|
4913
|
+
continue;
|
|
4914
|
+
}
|
|
4915
|
+
const result = RawJSONLinesSchema.safeParse(parsed);
|
|
4916
|
+
if (!result.success) continue;
|
|
4917
|
+
sink.send(result.data);
|
|
4918
|
+
replayed += 1;
|
|
4919
|
+
}
|
|
4920
|
+
if (replayed > 0) sink.closeTurn();
|
|
4921
|
+
return replayed;
|
|
4922
|
+
}
|
|
4923
|
+
|
|
4789
4924
|
const ANALYZE_MIN_INTERVAL_MS = 5 * 60 * 1e3;
|
|
4790
4925
|
const HOURLY_LIMIT = 30;
|
|
4791
4926
|
const HOURLY_WINDOW_MS = 60 * 60 * 1e3;
|
|
@@ -5074,4 +5209,4 @@ function resolveMessageMode(current, meta, ctx) {
|
|
|
5074
5209
|
};
|
|
5075
5210
|
}
|
|
5076
5211
|
|
|
5077
|
-
export { BoardAnalyzer, FileRateLimiter, PrewarmHookGate, SessionExitGate, acquirePrewarmSlot, claudeCheckSession, claudeModeHash, claudePrewarmEligibility, claudePrewarmSessionEligibility, cleanupHookSettingsFile, contentLogMetadata, createClaudePrewarmLease, disposeAllClaudePrewarms, evaluatePrewarmPrediction, exitIntentFromArchiveFlag, formatPrewarmLine, generateHookSettingsFile, getProjectPath, loop, parseSpecialCommand, prewarmCacheFile, prewarmPredictionMeta, prewarmSlotDir, readPrewarmCache, registerSideQuestionHandler, resolveMessageMode, settleSessionOnExit, startHookServer, withAssistantDenylist, writePrewarmCache, writeSideQuestionSettingsFile };
|
|
5212
|
+
export { BoardAnalyzer, FileRateLimiter, PrewarmHookGate, RawJSONLinesSchema, SessionExitGate, acquirePrewarmSlot, claudeCheckSession, claudeModeHash, claudePrewarmEligibility, claudePrewarmSessionEligibility, cleanupHookSettingsFile, contentLogMetadata, createClaudePrewarmLease, disposeAllClaudePrewarms, evaluatePrewarmPrediction, exitIntentFromArchiveFlag, formatPrewarmLine, generateHookSettingsFile, getProjectPath, loop, parseSpecialCommand, prewarmCacheFile, prewarmPredictionMeta, prewarmSlotDir, readPrewarmCache, registerSideQuestionHandler, replayClaudeForkJsonl, resolveMessageMode, settleSessionOnExit, startHookServer, withAssistantDenylist, writePrewarmCache, writeSideQuestionSettingsFile };
|