very-happy-cli 0.2.161 → 0.2.163
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-Ba98QDif.cjs → AcpBackend-C2rzKnvT.cjs} +3 -3
- package/dist/{AcpBackend-6U6pQgx1.mjs → AcpBackend-CuOUXVRX.mjs} +3 -3
- package/dist/{AcpSessionManager-CoMWFVw3.mjs → AcpSessionManager-BSIBnWUb.mjs} +1 -1
- package/dist/{AcpSessionManager-BAY1Pggx.cjs → AcpSessionManager-BvIuBzoO.cjs} +1 -1
- package/dist/{BasePermissionHandler-2R0uH2CI.cjs → BasePermissionHandler-D6PdH-OU.cjs} +1 -1
- package/dist/{BasePermissionHandler-BvvhBTja.mjs → BasePermissionHandler-Ng5h8JpY.mjs} +1 -1
- package/dist/{BaseReasoningProcessor-fsVNmCEF.cjs → BaseReasoningProcessor-C0cXz1mg.cjs} +1 -1
- package/dist/{BaseReasoningProcessor-DyhO1uoU.mjs → BaseReasoningProcessor-CM-ijU4F.mjs} +1 -1
- package/dist/{agentHome-Ck1i1TQB.mjs → agentHome-Bt4lOwFE.mjs} +4 -4
- package/dist/{agentHome-DvNnGphb.cjs → agentHome-CAMEVRZZ.cjs} +4 -4
- package/dist/{api-SffjRQ1b.mjs → api-D5kfP3JF.mjs} +26 -10
- package/dist/{api-B2vLMS-z.cjs → api-DGFBAPr7.cjs} +26 -10
- package/dist/{apiMachine-gFA54X7y.cjs → apiMachine-BxCy5_No.cjs} +33 -26
- package/dist/{apiMachine-BpW9t8MO.mjs → apiMachine-C58eizxs.mjs} +21 -14
- package/dist/{assistantTools-CgiTbnWb.mjs → assistantTools-BvKH9eRc.mjs} +6 -6
- package/dist/{assistantTools-BfA0R3_m.cjs → assistantTools-NC7DMNvV.cjs} +6 -6
- package/dist/{attachmentContent-CSGxr71v.mjs → attachmentContent-CCE0Y3gR.mjs} +2 -2
- package/dist/{attachmentContent-DMMZzevR.cjs → attachmentContent-CUKdzh4v.cjs} +2 -2
- package/dist/{attachmentLimits-yba1uHFO.mjs → attachmentLimits-D5pgmASK.mjs} +1 -1
- package/dist/{attachmentLimits-CzVrqgLR.cjs → attachmentLimits-DzlBPyJP.cjs} +1 -1
- package/dist/{auth-x4CEoysH.cjs → auth-CILb5DeW.cjs} +8 -8
- package/dist/{auth-CYHjQ8oQ.mjs → auth-CRm8yNv6.mjs} +5 -5
- package/dist/{auth-Bt4ceBBy.cjs → auth-Ddz597Rw.cjs} +5 -5
- package/dist/{auth-DdyVZSo6.mjs → auth-gdc8gI9D.mjs} +8 -8
- package/dist/{auto-BDXDUnjB.cjs → auto-CXtt6MfS.cjs} +16 -14
- package/dist/{auto-CXLlRi3a.mjs → auto-lLjHfAOO.mjs} +16 -14
- package/dist/{bootstrap-CkgIq8N3.cjs → bootstrap-CccIDvh4.cjs} +2 -2
- package/dist/{bootstrap-BNQq05jR.mjs → bootstrap-DSWZAtGy.mjs} +2 -2
- package/dist/{browser-9pyhQr1R.mjs → browser-DU9kI-Q-.mjs} +1 -1
- package/dist/{browser-BDOlKWYe.cjs → browser-lizgdXYj.cjs} +1 -1
- package/dist/{claudeLocal-BDuGFnjJ.cjs → claudeLocal-Bp-lf6yb.cjs} +5 -5
- package/dist/{claudeLocal-CQa8qnwq.mjs → claudeLocal-CTR2xlPT.mjs} +5 -5
- package/dist/{claudeLocalLauncher-CDqQI9ak.mjs → claudeLocalLauncher-DFkwLMqU.mjs} +10 -10
- package/dist/{claudeLocalLauncher-Bd5I2-j6.cjs → claudeLocalLauncher-aQyL3g7I.cjs} +10 -10
- package/dist/{codexThreadFork-BCaEMBiM.mjs → claudeSessionFork-DABSCbkf.mjs} +2 -134
- package/dist/{codexThreadFork-BZqF-9bX.cjs → claudeSessionFork-DdJFvxwf.cjs} +1 -137
- package/dist/{client-Brn-UwVk.mjs → client-BbNFS1WW.mjs} +3 -3
- package/dist/{client-DOBWJL3u.cjs → client-CQzHoynf.cjs} +2 -2
- package/dist/{client-C_axwRry.cjs → client-CXvsRLAz.cjs} +3 -3
- package/dist/{client-CXb1VJui.mjs → client-CyUhxs-0.mjs} +2 -2
- package/dist/codex/happyMcpStdioBridge.cjs +15 -15
- package/dist/codex/happyMcpStdioBridge.mjs +15 -15
- package/dist/{codexAppServerClient-ZzhUTWPo.cjs → codexAppServerClient-5jNbTlE5.cjs} +2 -2
- package/dist/{codexAppServerClient-oeQKD6Qf.mjs → codexAppServerClient-Dto99RVH.mjs} +2 -2
- package/dist/{codexCommand-CJ82bl3l.mjs → codexCommand-BHfrAyds.mjs} +49 -41
- package/dist/{codexCommand-C7H0NpBe.cjs → codexCommand-LUp0vkNi.cjs} +49 -41
- package/dist/codexThreadFork-DNekT4nQ.cjs +138 -0
- package/dist/codexThreadFork-R76RU5H0.mjs +133 -0
- package/dist/{config-BglnktIo.mjs → config-BEvt_OYR.mjs} +3 -3
- package/dist/{config-CYpL1Ahd.cjs → config-CAD5NR1h.cjs} +3 -3
- package/dist/{configuration-DoWFJUPm.mjs → configuration-B0c-OP_h.mjs} +1 -1
- package/dist/{configuration-v9f8LM9T.cjs → configuration-CepfrPZ_.cjs} +1 -1
- package/dist/{connect-yEvjdRvx.cjs → connect-BPMzMoiQ.cjs} +13 -13
- package/dist/{connect-hgcNjyAB.mjs → connect-BeK0dMYB.mjs} +13 -13
- package/dist/{context-B45vMtSZ.cjs → context-BhZMRQho.cjs} +1 -1
- package/dist/{context-C9GHPLEm.mjs → context-mMg17HJv.mjs} +1 -1
- package/dist/{controlClient-DjoKTtgK.mjs → controlClient-BKmjlbGs.mjs} +3 -3
- package/dist/{controlClient-fEHE85bH.cjs → controlClient-HPMsyxLb.cjs} +3 -3
- package/dist/{createSessionMetadata-BRLB9CNO.cjs → createSessionMetadata-CGuyVxsM.cjs} +2 -2
- package/dist/{createSessionMetadata-mIeehclp.mjs → createSessionMetadata-KOL67aSN.mjs} +2 -2
- package/dist/{deterministicJson-DKDP_mM-.cjs → deterministicJson-BFzPcsCh.cjs} +9 -9
- package/dist/{deterministicJson-p835AdAU.mjs → deterministicJson-CaWami7M.mjs} +9 -9
- package/dist/{doctor-hVNnSZJn.cjs → doctor-BHNVY9DE.cjs} +6 -6
- package/dist/{doctor-BeUuQXFs.mjs → doctor-DX2P7IlL.mjs} +6 -6
- package/dist/{ensureDaemonRunning-Dg9aZfjs.cjs → ensureDaemonRunning-BahhZpQ1.cjs} +5 -5
- package/dist/{ensureDaemonRunning-CO7d1gOC.mjs → ensureDaemonRunning-CnWMrL5b.mjs} +5 -5
- package/dist/forkBackfill-8eLDeS73.cjs +66 -0
- package/dist/forkBackfill-DYIjlN1Z.mjs +62 -0
- package/dist/{handleResumeCommand-DnVmy7a3.cjs → handleResumeCommand-Ca334R4t.cjs} +5 -5
- package/dist/{handleResumeCommand-BiTPK0qd.mjs → handleResumeCommand-bToC6FDH.mjs} +5 -5
- package/dist/{index-CAFwetLk.mjs → index-B5v5fZi6.mjs} +37 -37
- package/dist/{index-gNTWtSKN.cjs → index-B6MVw_Xb.cjs} +3 -3
- package/dist/{index-qdS1friN.mjs → index-BBg9j0XK.mjs} +8 -1
- package/dist/{index-SPGPenK5.mjs → index-CpFreRx8.mjs} +4 -4
- package/dist/{index-Cqx-Raq6.mjs → index-D3AsOj4j.mjs} +3 -3
- package/dist/{index-DA7yINuk.cjs → index-DJ-oV52i.cjs} +8 -1
- package/dist/{index-Pf2cV9cn.cjs → index-DoMsO8_G.cjs} +4 -4
- package/dist/{index-LIn6nCcq.cjs → index-vFMUVtSL.cjs} +36 -36
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{install-Bu85vlHD.cjs → install-BnTP73AE.cjs} +3 -3
- package/dist/{install-ClUUl3yp.mjs → install-Dixfzmb_.mjs} +3 -3
- package/dist/lib.cjs +12 -12
- package/dist/lib.d.cts +26 -0
- package/dist/lib.d.mts +26 -0
- package/dist/lib.mjs +12 -12
- package/dist/{lidState-KHHu1015.cjs → lidState-BGWXfx1e.cjs} +1 -1
- package/dist/{lidState-C2dI0FAN.mjs → lidState-X7iQg4y5.mjs} +1 -1
- package/dist/{localHappyAgentAuth-BXiHPXdC.cjs → localHappyAgentAuth-D_Gc4K7h.cjs} +1 -1
- package/dist/{localHappyAgentAuth-DCsetiyG.mjs → localHappyAgentAuth-r83bTscW.mjs} +1 -1
- package/dist/{logger-fXoNzNuB.mjs → logger-BIzr7JN0.mjs} +2 -2
- package/dist/{logger-Bc8-u1w0.cjs → logger-Ca5eRZ2j.cjs} +2 -2
- package/dist/{machineMetadata-BHjehxJY.mjs → machineMetadata-DakW9c61.mjs} +3 -3
- package/dist/{machineMetadata-BibDMFVx.cjs → machineMetadata-GlObivJ-.cjs} +3 -3
- package/dist/{main-BktM4A1K.mjs → main-BJlGidfv.mjs} +44 -44
- package/dist/{main-CLaX-t-b.cjs → main-BfA1Vtqq.cjs} +44 -44
- package/dist/{mcp-GBfE70nk.cjs → mcp-BVzt1llv.cjs} +14 -14
- package/dist/{mcp-CeUd9KDr.mjs → mcp-Bb7AD1SD.mjs} +14 -14
- package/dist/{package-Cl5BEP5x.cjs → package-BfnmIH4b.cjs} +7 -7
- package/dist/{package-uOg9SCKi.mjs → package-D-W_r_pd.mjs} +7 -7
- package/dist/{peerTools-Dz3_7Bkk.mjs → peerTools-C1cELmtZ.mjs} +4 -4
- package/dist/{peerTools-CIeiy9wn.cjs → peerTools-CADjnFDx.cjs} +4 -4
- package/dist/{persistence-CBNMzSa8.cjs → persistence-Ceb-BPk6.cjs} +3 -3
- package/dist/{persistence-oET5n61f.mjs → persistence-DgBhXxu7.mjs} +3 -3
- package/dist/{piRunnerArgs-Bf7RUF__.cjs → piRunnerArgs-Bem-saSg.cjs} +1 -1
- package/dist/{piRunnerArgs-Dk1ncwHF.mjs → piRunnerArgs-CH6oh6w0.mjs} +1 -1
- package/dist/{piRuntime-BwRdhK_N.mjs → piRuntime-BRKG6Yoz.mjs} +1 -1
- package/dist/{piRuntime-B_6TE9Eb.cjs → piRuntime-Be0UP44z.cjs} +1 -1
- package/dist/{piTerminal-Bap3R8Re.mjs → piTerminal-DVOAWiZx.mjs} +16 -16
- package/dist/{piTerminal-CagmEoez.cjs → piTerminal-ibKBMmuK.cjs} +16 -16
- package/dist/{registerCommonHandlers-BjSV2Skz.cjs → registerCommonHandlers-DPOHFlxp.cjs} +2 -2
- package/dist/{registerCommonHandlers-CrgvJsOy.mjs → registerCommonHandlers-t15dS7xt.mjs} +2 -2
- package/dist/{registerKillSessionHandler-Cbc8Rgtd.mjs → registerKillSessionHandler-BS5afGeA.mjs} +11 -7
- package/dist/{registerKillSessionHandler-6TC2S3lf.cjs → registerKillSessionHandler-DGDubZLv.cjs} +11 -7
- package/dist/{remoteSessionClient-BNx78NLb.cjs → remoteSessionClient-DbnVs1Tv.cjs} +5 -5
- package/dist/{remoteSessionClient-CO7qOjR0.mjs → remoteSessionClient-N7JsQ0XS.mjs} +5 -5
- package/dist/{run-D5xAEWSB.cjs → run-CptLbkQ4.cjs} +32 -32
- package/dist/{run-2l5vSt2h.mjs → run-FZRugy70.mjs} +31 -31
- package/dist/{runClaude-BX6ixjtW.cjs → runClaude-Cnv0SnA4.cjs} +24 -21
- package/dist/{runClaude-BgN6xo05.mjs → runClaude-DNW3i-k4.mjs} +24 -21
- package/dist/{runClaudeDeps-COBBhD9o.mjs → runClaudeDeps-CpAiml84.mjs} +216 -39
- package/dist/{runClaudeDeps-Bp20MScE.cjs → runClaudeDeps-lb6LlVPa.cjs} +212 -35
- package/dist/{runGemini-CSMPkt0p.cjs → runGemini-BzS_Yw3F.cjs} +32 -32
- package/dist/{runGemini-Cc2jq-uh.mjs → runGemini-CRn8exeY.mjs} +32 -32
- package/dist/{runOpenClaw-CIlCwdW2.mjs → runOpenClaw-DuS_zRVT.mjs} +18 -18
- package/dist/{runOpenClaw-YBwua4Rf.cjs → runOpenClaw-QoDQpR9a.cjs} +18 -18
- package/dist/{sandbox-C4gXLP1p.cjs → sandbox-CT9CGjEI.cjs} +4 -4
- package/dist/{sandbox-CNkwOtHI.mjs → sandbox-DysMM_pn.mjs} +4 -4
- package/dist/selfCheck-BTltA-ZZ.mjs +84 -0
- package/dist/{selfCheck-CU8xSDsl.cjs → selfCheck-DIn7j8MD.cjs} +34 -34
- package/dist/{send-DY9Nr-x4.cjs → send-97xYN_Yw.cjs} +8 -8
- package/dist/{send-CGHcKZ-w.mjs → send-CA6fSF3S.mjs} +8 -8
- package/dist/{server-II51Mimf.cjs → server-C67NGJoX.cjs} +6 -6
- package/dist/{server-m2b5pamZ.mjs → server-r50NNW9e.mjs} +4 -4
- package/dist/{sessionLock-7ePAYDOg.cjs → sessionLock-CS4fdsmu.cjs} +2 -2
- package/dist/{sessionLock-Cw6FmbMv.mjs → sessionLock-Dab6_dCd.mjs} +2 -2
- package/dist/{sessionModeFile-CDmDyRkD.mjs → sessionModeFile-3yV7P9R-.mjs} +1 -1
- package/dist/{sessionModeFile-BVCV5f7E.cjs → sessionModeFile-BhqlFlHZ.cjs} +1 -1
- package/dist/{sessionOps-C_f1wKOr.mjs → sessionOps-DJSwzwP-.mjs} +5 -5
- package/dist/{sessionOps-DJdExmBy.cjs → sessionOps-DWsGWwfZ.cjs} +4 -4
- package/dist/{sessionScanner-D1goKdd3.cjs → sessionScanner-D6WqRtJQ.cjs} +3 -3
- package/dist/{sessionScanner-CaAHLyNV.mjs → sessionScanner-jilpq2aE.mjs} +3 -3
- package/dist/{sessions-DGs6ALNo.cjs → sessions-C22q-Z_s.cjs} +9 -9
- package/dist/{sessions-DnvmWUel.mjs → sessions-RXTp4x0o.mjs} +9 -9
- package/dist/{setupOfflineReconnection-R7XuR_sj.cjs → setupOfflineReconnection-BrnWBRUP.cjs} +2 -2
- package/dist/{setupOfflineReconnection-CVViqZft.mjs → setupOfflineReconnection-rd1PCWiN.mjs} +2 -2
- package/dist/{spawn-CXTH7qg1.cjs → spawn-Ccy5qAtp.cjs} +41 -19
- package/dist/{spawn-DNYSvFtC.mjs → spawn-D8CEQPbN.mjs} +39 -18
- package/dist/{spawnAgents-DZzZ9jMI.mjs → spawnAgents-Y1LjnCt9.mjs} +1 -1
- package/dist/{spawnAgents-BGQiEF-w.cjs → spawnAgents-iSu1Xzs5.cjs} +1 -1
- package/dist/{spawnHappyCLI-BhYj84rv.cjs → spawnHappyCLI-Dz2ZHrsN.cjs} +1 -1
- package/dist/{spawnHappyCLI-cqWQbwsb.mjs → spawnHappyCLI-wowHF2IL.mjs} +1 -1
- package/dist/{startFileWatcher-CdegMbJj.mjs → startFileWatcher-C1wjDI_o.mjs} +1 -1
- package/dist/{startFileWatcher-CKKx-8ZO.cjs → startFileWatcher-Ce17H9pG.cjs} +1 -1
- package/dist/{streamRelay-FPVbHpbM.mjs → streamRelay-BLgU9X3R.mjs} +1 -1
- package/dist/{streamRelay-BiKw59Cc.cjs → streamRelay-DnObXZZj.cjs} +1 -1
- package/dist/{sync-CxD-w_40.mjs → sync-DnmsgL3w.mjs} +5 -1
- package/dist/{sync-CVk4QERO.cjs → sync-fDRF_nO1.cjs} +5 -1
- package/dist/{systemPrompt-BygJcmbi.cjs → systemPrompt-9PWg4OU6.cjs} +2 -2
- package/dist/{systemPrompt-DmtypUc7.mjs → systemPrompt-Db9O7KGe.mjs} +2 -2
- package/dist/{teams-BOC6nIPL.mjs → teams-C5PwKr4K.mjs} +6 -6
- package/dist/{teams-BsvpOBfn.cjs → teams-DkHPUc6j.cjs} +6 -6
- package/dist/{time-BZNdNiIV.mjs → time-TxDyvAKk.mjs} +1 -1
- package/dist/{time-CNRE4ChD.cjs → time-xNkWLTSj.cjs} +1 -1
- package/dist/{titleGenerator-CFRhU-xq.cjs → titleGenerator-C8arvXNG.cjs} +13 -3
- package/dist/{titleGenerator-ox6ptCsp.mjs → titleGenerator-oK414IZc.mjs} +12 -2
- package/dist/{todo-C5KBVbUw.mjs → todo-CLHIGRUf.mjs} +6 -6
- package/dist/{todo-B-KB7oAB.cjs → todo-VqQuYyFq.cjs} +6 -6
- package/dist/{tools-BZabNIid.mjs → tools-BSzD246o.mjs} +2 -2
- package/dist/{tools-CsSovyNp.cjs → tools-GnqHEZHb.cjs} +2 -2
- package/dist/{tools-BmQQUATY.mjs → tools-sPgOmLr_.mjs} +1 -1
- package/dist/{tools-lMDra4Pv.cjs → tools-xQ38ufgo.cjs} +1 -1
- package/dist/{uninstall-fvA5aWpU.cjs → uninstall-DKM0j1qI.cjs} +3 -3
- package/dist/{uninstall-B1WLtC1d.mjs → uninstall-DyoXxpgI.mjs} +3 -3
- package/package.json +7 -7
- package/dist/selfCheck-hJ6PCh7v.mjs +0 -84
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { e as encodeBase64, c as credentialRelayProblem, f as encodeBase64Url, d as decodeBase64 } from './authRelay-DSAvg1uv.mjs';
|
|
2
|
-
import { c as configuration } from './configuration-
|
|
2
|
+
import { c as configuration } from './configuration-B0c-OP_h.mjs';
|
|
3
3
|
import { randomUUID, randomBytes } from 'node:crypto';
|
|
4
4
|
import tweetnacl from 'tweetnacl';
|
|
5
5
|
import axios from 'axios';
|
|
6
|
-
import { d as delay } from './time-
|
|
7
|
-
import { readCredentials, readSettingsOutcome, updateSettings, writeCredentialsLegacy, writeCredentialsDataKey } from './persistence-
|
|
8
|
-
import { o as openBrowser } from './browser-
|
|
9
|
-
import { l as logger } from './logger-
|
|
6
|
+
import { d as delay } from './time-TxDyvAKk.mjs';
|
|
7
|
+
import { readCredentials, readSettingsOutcome, updateSettings, writeCredentialsLegacy, writeCredentialsDataKey } from './persistence-DgBhXxu7.mjs';
|
|
8
|
+
import { o as openBrowser } from './browser-DU9kI-Q-.mjs';
|
|
9
|
+
import { l as logger } from './logger-BIzr7JN0.mjs';
|
|
10
10
|
|
|
11
11
|
function generateWebAuthUrl(publicKey) {
|
|
12
12
|
const publicKeyBase64 = encodeBase64(publicKey, "base64url");
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var authRelay = require('./authRelay-BdYkC1Po.cjs');
|
|
4
|
-
var configuration = require('./configuration-
|
|
4
|
+
var configuration = require('./configuration-CepfrPZ_.cjs');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
6
|
var tweetnacl = require('tweetnacl');
|
|
7
7
|
var axios = require('axios');
|
|
8
|
-
var time = require('./time-
|
|
9
|
-
var persistence = require('./persistence-
|
|
10
|
-
var browser = require('./browser-
|
|
11
|
-
var logger = require('./logger-
|
|
8
|
+
var time = require('./time-xNkWLTSj.cjs');
|
|
9
|
+
var persistence = require('./persistence-Ceb-BPk6.cjs');
|
|
10
|
+
var browser = require('./browser-lizgdXYj.cjs');
|
|
11
|
+
var logger = require('./logger-Ca5eRZ2j.cjs');
|
|
12
12
|
|
|
13
13
|
function generateWebAuthUrl(publicKey) {
|
|
14
14
|
const publicKeyBase64 = authRelay.encodeBase64(publicKey, "base64url");
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { readCredentials, readSettings, clearCredentials, clearMachineId } from './persistence-
|
|
3
|
-
import { a as authAndSetupMachineIfNeeded } from './auth-
|
|
4
|
-
import { c as configuration } from './configuration-
|
|
2
|
+
import { readCredentials, readSettings, clearCredentials, clearMachineId } from './persistence-DgBhXxu7.mjs';
|
|
3
|
+
import { a as authAndSetupMachineIfNeeded } from './auth-CRm8yNv6.mjs';
|
|
4
|
+
import { c as configuration } from './configuration-B0c-OP_h.mjs';
|
|
5
5
|
import { existsSync, rmSync } from 'node:fs';
|
|
6
6
|
import { createInterface } from 'node:readline';
|
|
7
|
-
import { c as checkIfDaemonRunningAndCleanupStaleState, a as stopDaemon } from './controlClient-
|
|
8
|
-
import { l as logger } from './logger-
|
|
7
|
+
import { c as checkIfDaemonRunningAndCleanupStaleState, a as stopDaemon } from './controlClient-BKmjlbGs.mjs';
|
|
8
|
+
import { l as logger } from './logger-BIzr7JN0.mjs';
|
|
9
9
|
import os from 'node:os';
|
|
10
10
|
import { c as credentialRelayProblem } from './authRelay-DSAvg1uv.mjs';
|
|
11
11
|
import 'node:fs/promises';
|
|
12
12
|
import 'zod';
|
|
13
13
|
import 'node:path';
|
|
14
|
-
import './package-
|
|
14
|
+
import './package-D-W_r_pd.mjs';
|
|
15
15
|
import 'node:crypto';
|
|
16
16
|
import 'tweetnacl';
|
|
17
17
|
import 'node:util';
|
|
18
18
|
import 'axios';
|
|
19
|
-
import './time-
|
|
20
|
-
import './browser-
|
|
19
|
+
import './time-TxDyvAKk.mjs';
|
|
20
|
+
import './browser-DU9kI-Q-.mjs';
|
|
21
21
|
import 'open';
|
|
22
22
|
|
|
23
23
|
function localMachineIdentityStatus(machineId) {
|
|
@@ -4,43 +4,45 @@ var chalk = require('chalk');
|
|
|
4
4
|
var os = require('node:os');
|
|
5
5
|
var node_fs = require('node:fs');
|
|
6
6
|
var path = require('node:path');
|
|
7
|
-
var index = require('./index-
|
|
8
|
-
var configuration = require('./configuration-
|
|
9
|
-
var client = require('./client-
|
|
7
|
+
var index = require('./index-DJ-oV52i.cjs');
|
|
8
|
+
var configuration = require('./configuration-CepfrPZ_.cjs');
|
|
9
|
+
var client = require('./client-CQzHoynf.cjs');
|
|
10
10
|
var template = require('./template-BaHAmH2K.cjs');
|
|
11
11
|
var install = require('./install-Cs5qAPrB.cjs');
|
|
12
|
-
var sessionOps = require('./sessionOps-
|
|
13
|
-
var spawn = require('./spawn-
|
|
14
|
-
var spawnAgents = require('./spawnAgents-
|
|
15
|
-
var time = require('./time-
|
|
12
|
+
var sessionOps = require('./sessionOps-DWsGWwfZ.cjs');
|
|
13
|
+
var spawn = require('./spawn-Ccy5qAtp.cjs');
|
|
14
|
+
var spawnAgents = require('./spawnAgents-iSu1Xzs5.cjs');
|
|
15
|
+
var time = require('./time-xNkWLTSj.cjs');
|
|
16
16
|
require('zod');
|
|
17
17
|
require('@paralleldrive/cuid2');
|
|
18
|
-
require('./package-
|
|
18
|
+
require('./package-BfnmIH4b.cjs');
|
|
19
19
|
require('node:fs/promises');
|
|
20
|
-
require('./persistence-
|
|
20
|
+
require('./persistence-Ceb-BPk6.cjs');
|
|
21
21
|
require('./authRelay-BdYkC1Po.cjs');
|
|
22
22
|
require('node:crypto');
|
|
23
23
|
require('tweetnacl');
|
|
24
|
-
require('./logger-
|
|
24
|
+
require('./logger-Ca5eRZ2j.cjs');
|
|
25
25
|
require('node:util');
|
|
26
26
|
require('./resources-JDPugcDq.cjs');
|
|
27
27
|
require('axios');
|
|
28
|
-
require('./controlClient-
|
|
28
|
+
require('./controlClient-HPMsyxLb.cjs');
|
|
29
29
|
require('socket.io-client');
|
|
30
30
|
require('./backgroundTaskActivity-CBvUdj39.cjs');
|
|
31
31
|
require('./path-B7zW-WwE.cjs');
|
|
32
|
-
require('./
|
|
32
|
+
require('./claudeSessionFork-DdJFvxwf.cjs');
|
|
33
33
|
require('node:readline');
|
|
34
|
-
require('./codexAppServerClient-
|
|
34
|
+
require('./codexAppServerClient-5jNbTlE5.cjs');
|
|
35
35
|
require('node:child_process');
|
|
36
36
|
require('cross-spawn');
|
|
37
37
|
require('./contentLogMetadata-ZSFk_NjQ.cjs');
|
|
38
38
|
require('./manager-Cly8xVIR.cjs');
|
|
39
39
|
require('@anthropic-ai/sandbox-runtime');
|
|
40
|
-
require('./
|
|
40
|
+
require('./codexThreadFork-DNekT4nQ.cjs');
|
|
41
|
+
require('./createSessionMetadata-CGuyVxsM.cjs');
|
|
41
42
|
require('./projectPath-ChLhdOyt.cjs');
|
|
42
43
|
require('path');
|
|
43
44
|
require('url');
|
|
45
|
+
require('./forkBackfill-8eLDeS73.cjs');
|
|
44
46
|
|
|
45
47
|
const AUTO_ACTIONS = ["list", "show", "create", "edit", "pause", "resume", "rm", "run", "fire", "runs", "cancel", "ack", "report", "skill", "install", "uninstall", "help"];
|
|
46
48
|
const VALUE_FLAGS = ["--name", "--rename", "--description", "--machine", "--cron", "--tz", "--every", "--at", "--spawn-dir", "--prompt", "--prompt-file", "--agent", "--model", "--permission-mode", "--sticky-key", "--send-session", "--cwd", "--env", "--timeout", "--concurrency", "--max-runtime", "--payload", "--payload-json", "--payload-file", "--dedupe-key", "--status", "--limit", "--run", "--summary", "--error", "--attention", "--host", "--home"];
|
|
@@ -2,43 +2,45 @@ import chalk from 'chalk';
|
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
4
|
import { resolve } from 'node:path';
|
|
5
|
-
import { A as AUTOMATION_NAME_PATTERN, i as isAutomationRunTerminal } from './index-
|
|
6
|
-
import { c as configuration } from './configuration-
|
|
7
|
-
import { a as authenticatedAutomationsClient, b as automationRunIdFromEnv, i as isAutomationsUnavailable, A as AUTOMATIONS_UNAVAILABLE_MESSAGE } from './client-
|
|
5
|
+
import { A as AUTOMATION_NAME_PATTERN, i as isAutomationRunTerminal } from './index-BBg9j0XK.mjs';
|
|
6
|
+
import { c as configuration } from './configuration-B0c-OP_h.mjs';
|
|
7
|
+
import { a as authenticatedAutomationsClient, b as automationRunIdFromEnv, i as isAutomationsUnavailable, A as AUTOMATIONS_UNAVAILABLE_MESSAGE } from './client-CyUhxs-0.mjs';
|
|
8
8
|
import { p as parseDuration, t as triggerFromFlags, d as describeTrigger, a as describeAction } from './template-CiOPa2rd.mjs';
|
|
9
9
|
import { A as AUTOMATION_SKILL, i as installAutomationSkill } from './install-BO_W7VhL.mjs';
|
|
10
|
-
import { s as sessionWebUrl } from './sessionOps-
|
|
11
|
-
import { parseEnvAssignment } from './spawn-
|
|
12
|
-
import { S as SPAWN_AGENTS, s as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES } from './spawnAgents-
|
|
13
|
-
import { d as delay } from './time-
|
|
10
|
+
import { s as sessionWebUrl } from './sessionOps-DJSwzwP-.mjs';
|
|
11
|
+
import { parseEnvAssignment } from './spawn-D8CEQPbN.mjs';
|
|
12
|
+
import { S as SPAWN_AGENTS, s as sanitizeSpawnPermissionMode, A as ALLOWED_SPAWN_PERMISSION_MODES } from './spawnAgents-Y1LjnCt9.mjs';
|
|
13
|
+
import { d as delay } from './time-TxDyvAKk.mjs';
|
|
14
14
|
import 'zod';
|
|
15
15
|
import '@paralleldrive/cuid2';
|
|
16
|
-
import './package-
|
|
16
|
+
import './package-D-W_r_pd.mjs';
|
|
17
17
|
import 'node:fs/promises';
|
|
18
|
-
import './persistence-
|
|
18
|
+
import './persistence-DgBhXxu7.mjs';
|
|
19
19
|
import './authRelay-DSAvg1uv.mjs';
|
|
20
20
|
import 'node:crypto';
|
|
21
21
|
import 'tweetnacl';
|
|
22
|
-
import './logger-
|
|
22
|
+
import './logger-BIzr7JN0.mjs';
|
|
23
23
|
import 'node:util';
|
|
24
24
|
import './resources-BdFBQi8r.mjs';
|
|
25
25
|
import 'axios';
|
|
26
|
-
import './controlClient-
|
|
26
|
+
import './controlClient-BKmjlbGs.mjs';
|
|
27
27
|
import 'socket.io-client';
|
|
28
28
|
import './backgroundTaskActivity-8PdPxrvy.mjs';
|
|
29
29
|
import './path-D2wdaNSk.mjs';
|
|
30
|
-
import './
|
|
30
|
+
import './claudeSessionFork-DABSCbkf.mjs';
|
|
31
31
|
import 'node:readline';
|
|
32
|
-
import './codexAppServerClient-
|
|
32
|
+
import './codexAppServerClient-Dto99RVH.mjs';
|
|
33
33
|
import 'node:child_process';
|
|
34
34
|
import 'cross-spawn';
|
|
35
35
|
import './contentLogMetadata-BlWI0egu.mjs';
|
|
36
36
|
import './manager-BQ4flvQZ.mjs';
|
|
37
37
|
import '@anthropic-ai/sandbox-runtime';
|
|
38
|
-
import './
|
|
38
|
+
import './codexThreadFork-R76RU5H0.mjs';
|
|
39
|
+
import './createSessionMetadata-KOL67aSN.mjs';
|
|
39
40
|
import './projectPath-BTBIMB57.mjs';
|
|
40
41
|
import 'path';
|
|
41
42
|
import 'url';
|
|
43
|
+
import './forkBackfill-DYIjlN1Z.mjs';
|
|
42
44
|
|
|
43
45
|
const AUTO_ACTIONS = ["list", "show", "create", "edit", "pause", "resume", "rm", "run", "fire", "runs", "cancel", "ack", "report", "skill", "install", "uninstall", "help"];
|
|
44
46
|
const VALUE_FLAGS = ["--name", "--rename", "--description", "--machine", "--cron", "--tz", "--every", "--at", "--spawn-dir", "--prompt", "--prompt-file", "--agent", "--model", "--permission-mode", "--sticky-key", "--send-session", "--cwd", "--env", "--timeout", "--concurrency", "--max-runtime", "--payload", "--payload-json", "--payload-file", "--dedupe-key", "--status", "--limit", "--run", "--summary", "--error", "--attention", "--host", "--home"];
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var node_fs = require('node:fs');
|
|
4
4
|
var promises = require('node:fs/promises');
|
|
5
5
|
var path = require('node:path');
|
|
6
|
-
var configuration = require('./configuration-
|
|
6
|
+
var configuration = require('./configuration-CepfrPZ_.cjs');
|
|
7
7
|
require('node:os');
|
|
8
|
-
require('./package-
|
|
8
|
+
require('./package-BfnmIH4b.cjs');
|
|
9
9
|
|
|
10
10
|
const ASSISTANT_CLAUDE_MD = `# very-happy \u8C03\u5EA6\u4E2D\u5FC3\uFF08\u8BED\u97F3\u52A9\u624B\uFF09
|
|
11
11
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
|
-
import { c as configuration } from './configuration-
|
|
4
|
+
import { c as configuration } from './configuration-B0c-OP_h.mjs';
|
|
5
5
|
import 'node:os';
|
|
6
|
-
import './package-
|
|
6
|
+
import './package-D-W_r_pd.mjs';
|
|
7
7
|
|
|
8
8
|
const ASSISTANT_CLAUDE_MD = `# very-happy \u8C03\u5EA6\u4E2D\u5FC3\uFF08\u8BED\u97F3\u52A9\u624B\uFF09
|
|
9
9
|
|
|
@@ -4,21 +4,21 @@ 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-Ca5eRZ2j.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-9PWg4OU6.cjs');
|
|
12
12
|
var manager = require('./manager-Cly8xVIR.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-CepfrPZ_.cjs');
|
|
18
18
|
require('node:os');
|
|
19
|
-
require('./package-
|
|
19
|
+
require('./package-BfnmIH4b.cjs');
|
|
20
20
|
require('node:fs/promises');
|
|
21
|
-
require('./index-
|
|
21
|
+
require('./index-DJ-oV52i.cjs');
|
|
22
22
|
require('zod');
|
|
23
23
|
require('@paralleldrive/cuid2');
|
|
24
24
|
require('./trimIdent-4gvk9Wk6.cjs');
|
|
@@ -2,21 +2,21 @@ import { spawn } from 'cross-spawn';
|
|
|
2
2
|
import { createInterface } from 'node:readline';
|
|
3
3
|
import { readdirSync, statSync, mkdirSync, existsSync } from 'node:fs';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
|
-
import { l as logger } from './logger-
|
|
5
|
+
import { l as logger } from './logger-BIzr7JN0.mjs';
|
|
6
6
|
import { p as pinSmallFastModel, e as ensureLocalProxyBypass } from './smallFastModel-BLNgMrwR.mjs';
|
|
7
7
|
import { join } from 'node:path';
|
|
8
8
|
import { g as getProjectPath } from './path-D2wdaNSk.mjs';
|
|
9
|
-
import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-
|
|
9
|
+
import { c as claudeCheckSession, s as systemPrompt } from './systemPrompt-Db9O7KGe.mjs';
|
|
10
10
|
import { i as initializeSandbox, a as wrapCommand } from './manager-BQ4flvQZ.mjs';
|
|
11
11
|
import { c as contentLogMetadata } from './contentLogMetadata-BlWI0egu.mjs';
|
|
12
12
|
import { claudeCliPath } from './claudeCliPath-BqkaH2oR.mjs';
|
|
13
13
|
import 'chalk';
|
|
14
14
|
import 'node:util';
|
|
15
|
-
import './configuration-
|
|
15
|
+
import './configuration-B0c-OP_h.mjs';
|
|
16
16
|
import 'node:os';
|
|
17
|
-
import './package-
|
|
17
|
+
import './package-D-W_r_pd.mjs';
|
|
18
18
|
import 'node:fs/promises';
|
|
19
|
-
import './index-
|
|
19
|
+
import './index-BBg9j0XK.mjs';
|
|
20
20
|
import 'zod';
|
|
21
21
|
import '@paralleldrive/cuid2';
|
|
22
22
|
import './trimIdent-BAjmv_TG.mjs';
|
|
@@ -1,21 +1,21 @@
|
|
|
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-BIzr7JN0.mjs';
|
|
2
|
+
import { claudeLocal, ExitCodeError } from './claudeLocal-CTR2xlPT.mjs';
|
|
3
|
+
import { c as createSessionScanner, F as Future } from './sessionScanner-jilpq2aE.mjs';
|
|
4
4
|
import 'chalk';
|
|
5
5
|
import 'node:util';
|
|
6
|
-
import './configuration-
|
|
6
|
+
import './configuration-B0c-OP_h.mjs';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
9
9
|
import 'node:path';
|
|
10
|
-
import './package-
|
|
10
|
+
import './package-D-W_r_pd.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-
|
|
18
|
-
import './index-
|
|
17
|
+
import './systemPrompt-Db9O7KGe.mjs';
|
|
18
|
+
import './index-BBg9j0XK.mjs';
|
|
19
19
|
import 'zod';
|
|
20
20
|
import '@paralleldrive/cuid2';
|
|
21
21
|
import './trimIdent-BAjmv_TG.mjs';
|
|
@@ -27,10 +27,10 @@ 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-DnmsgL3w.mjs';
|
|
31
|
+
import './time-TxDyvAKk.mjs';
|
|
32
32
|
import './types-CkqAACXx.mjs';
|
|
33
|
-
import './startFileWatcher-
|
|
33
|
+
import './startFileWatcher-C1wjDI_o.mjs';
|
|
34
34
|
import 'fs/promises';
|
|
35
35
|
|
|
36
36
|
async function claudeLocalLauncher(session) {
|
|
@@ -1,23 +1,23 @@
|
|
|
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-Ca5eRZ2j.cjs');
|
|
4
|
+
var claudeLocal = require('./claudeLocal-Bp-lf6yb.cjs');
|
|
5
|
+
var sessionScanner = require('./sessionScanner-D6WqRtJQ.cjs');
|
|
6
6
|
require('chalk');
|
|
7
7
|
require('node:util');
|
|
8
|
-
require('./configuration-
|
|
8
|
+
require('./configuration-CepfrPZ_.cjs');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:os');
|
|
11
11
|
require('node:path');
|
|
12
|
-
require('./package-
|
|
12
|
+
require('./package-BfnmIH4b.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-
|
|
20
|
-
require('./index-
|
|
19
|
+
require('./systemPrompt-9PWg4OU6.cjs');
|
|
20
|
+
require('./index-DJ-oV52i.cjs');
|
|
21
21
|
require('zod');
|
|
22
22
|
require('@paralleldrive/cuid2');
|
|
23
23
|
require('./trimIdent-4gvk9Wk6.cjs');
|
|
@@ -29,10 +29,10 @@ 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-fDRF_nO1.cjs');
|
|
33
|
+
require('./time-xNkWLTSj.cjs');
|
|
34
34
|
require('./types-CRS-srZK.cjs');
|
|
35
|
-
require('./startFileWatcher-
|
|
35
|
+
require('./startFileWatcher-Ce17H9pG.cjs');
|
|
36
36
|
require('fs/promises');
|
|
37
37
|
|
|
38
38
|
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-BIzr7JN0.mjs';
|
|
7
7
|
|
|
8
8
|
class ForkTruncateUuidNotFoundError extends Error {
|
|
9
9
|
constructor(cutAfterUuid, sourcePath) {
|
|
@@ -203,136 +203,4 @@ async function forkBeforeUserMessage(projectDir, sourceClaudeSessionId, cutBefor
|
|
|
203
203
|
return newId;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
constructor(itemId, threadId) {
|
|
208
|
-
super(`Codex rewind point ${itemId} not found in thread ${threadId}`);
|
|
209
|
-
this.itemId = itemId;
|
|
210
|
-
this.threadId = threadId;
|
|
211
|
-
this.name = "CodexForkRewindPointNotFoundError";
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
function hasUserAttachments(item) {
|
|
215
|
-
const content = item.content;
|
|
216
|
-
return Array.isArray(content) && content.some((part) => !part || typeof part !== "object" || part.type !== "text" || typeof part.text === "string" && part.text.includes("<attached_files>"));
|
|
217
|
-
}
|
|
218
|
-
function rejectAttachedTarget(thread, itemId) {
|
|
219
|
-
const item = thread.turns?.flatMap((turn) => turn.items ?? []).find((item2) => item2.id === itemId);
|
|
220
|
-
if (item && hasUserAttachments(item)) throw new Error("Cannot edit and rerun a message with attachments");
|
|
221
|
-
}
|
|
222
|
-
function textFromUserItem(item) {
|
|
223
|
-
if (item.type !== "userMessage") {
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
const content = item.content;
|
|
227
|
-
if (!Array.isArray(content)) {
|
|
228
|
-
return null;
|
|
229
|
-
}
|
|
230
|
-
const textParts = content.filter((part) => Boolean(part) && typeof part === "object" && part.type === "text" && typeof part.text === "string").map((part) => part.text).join("\n").trim();
|
|
231
|
-
return textParts.length > 0 ? textParts : null;
|
|
232
|
-
}
|
|
233
|
-
function timestampFromTurn(turn) {
|
|
234
|
-
const seconds = turn.startedAt ?? turn.completedAt;
|
|
235
|
-
return typeof seconds === "number" && Number.isFinite(seconds) ? seconds * 1e3 : Date.now();
|
|
236
|
-
}
|
|
237
|
-
function listCodexRewindPoints(thread) {
|
|
238
|
-
const points = [];
|
|
239
|
-
for (const turn of thread.turns ?? []) {
|
|
240
|
-
for (const item of turn.items ?? []) {
|
|
241
|
-
const text = textFromUserItem(item);
|
|
242
|
-
if (!text) {
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
points.push({
|
|
246
|
-
itemId: item.id,
|
|
247
|
-
text,
|
|
248
|
-
...hasUserAttachments(item) ? { hasAttachments: true } : {},
|
|
249
|
-
timestamp: timestampFromTurn(turn)
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
return points;
|
|
254
|
-
}
|
|
255
|
-
function findCutTurn(thread, itemId) {
|
|
256
|
-
const turns = thread.turns ?? [];
|
|
257
|
-
for (let index = 0; index < turns.length; index++) {
|
|
258
|
-
const turn = turns[index];
|
|
259
|
-
const item = (turn.items ?? []).find((candidate) => candidate.id === itemId);
|
|
260
|
-
if (!item) {
|
|
261
|
-
continue;
|
|
262
|
-
}
|
|
263
|
-
const text = textFromUserItem(item);
|
|
264
|
-
if (text) {
|
|
265
|
-
return { index, text };
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
async function forkCodexThread(client, opts) {
|
|
271
|
-
const forked = await client.forkThread({
|
|
272
|
-
threadId: opts.threadId,
|
|
273
|
-
...opts.cwd ? { cwd: opts.cwd } : {},
|
|
274
|
-
...opts.model ? { model: opts.model } : {},
|
|
275
|
-
...opts.approvalPolicy ? { approvalPolicy: opts.approvalPolicy } : {},
|
|
276
|
-
...opts.sandbox ? { sandbox: opts.sandbox } : {},
|
|
277
|
-
...opts.mcpServers ? { mcpServers: opts.mcpServers } : {}
|
|
278
|
-
});
|
|
279
|
-
if (opts.cutAfterItemId) {
|
|
280
|
-
const cutTurn = findCutTurn(forked.thread, opts.cutAfterItemId);
|
|
281
|
-
if (!cutTurn) {
|
|
282
|
-
throw new CodexForkRewindPointNotFoundError(opts.cutAfterItemId, opts.threadId);
|
|
283
|
-
}
|
|
284
|
-
const turns = forked.thread.turns ?? [];
|
|
285
|
-
const turnsToDrop = turns.length - cutTurn.index;
|
|
286
|
-
if (turnsToDrop > 0) {
|
|
287
|
-
await client.rollbackThread({
|
|
288
|
-
threadId: forked.threadId,
|
|
289
|
-
numTurns: turnsToDrop
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
await client.injectItems({
|
|
293
|
-
threadId: forked.threadId,
|
|
294
|
-
items: [{
|
|
295
|
-
type: "message",
|
|
296
|
-
role: "user",
|
|
297
|
-
content: [{ type: "input_text", text: cutTurn.text }]
|
|
298
|
-
}]
|
|
299
|
-
});
|
|
300
|
-
}
|
|
301
|
-
return {
|
|
302
|
-
type: "success",
|
|
303
|
-
newCodexThreadId: forked.threadId
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
async function forkCodexBeforeUserMessage(client, opts) {
|
|
307
|
-
const { thread: source } = await client.readThread({ threadId: opts.threadId, includeTurns: true });
|
|
308
|
-
rejectAttachedTarget(source, opts.cutBeforeItemId);
|
|
309
|
-
const sourceCut = findCutTurn(source, opts.cutBeforeItemId);
|
|
310
|
-
if (!sourceCut) throw new CodexForkRewindPointNotFoundError(opts.cutBeforeItemId, opts.threadId);
|
|
311
|
-
if ((source.turns?.[sourceCut.index].items ?? []).findIndex((item) => item.id === opts.cutBeforeItemId) !== 0) {
|
|
312
|
-
throw new Error("Cannot safely rewind a user message inside an existing turn");
|
|
313
|
-
}
|
|
314
|
-
if (sourceCut.index === 0) return { type: "success", startFresh: true };
|
|
315
|
-
const forked = await client.forkThread({ threadId: opts.threadId, cwd: opts.cwd });
|
|
316
|
-
if (forked.threadId === opts.threadId) throw new Error("Codex did not create an independent fork");
|
|
317
|
-
rejectAttachedTarget(forked.thread, opts.cutBeforeItemId);
|
|
318
|
-
const cut = findCutTurn(forked.thread, opts.cutBeforeItemId);
|
|
319
|
-
if (!cut) throw new CodexForkRewindPointNotFoundError(opts.cutBeforeItemId, opts.threadId);
|
|
320
|
-
const turns = forked.thread.turns ?? [];
|
|
321
|
-
const items = turns[cut.index].items ?? [];
|
|
322
|
-
if (items.findIndex((item) => item.id === opts.cutBeforeItemId) !== 0) {
|
|
323
|
-
throw new Error("Cannot safely rewind a user message inside an existing turn");
|
|
324
|
-
}
|
|
325
|
-
if (cut.index === 0) return { type: "success", startFresh: true };
|
|
326
|
-
const expectedTurnIds = turns.slice(0, cut.index).map((turn) => turn.id);
|
|
327
|
-
const { thread } = await client.rollbackThread({
|
|
328
|
-
threadId: forked.threadId,
|
|
329
|
-
numTurns: turns.length - cut.index
|
|
330
|
-
});
|
|
331
|
-
const remaining = thread.turns ?? [];
|
|
332
|
-
if (remaining.length !== cut.index || remaining.some((turn, index) => turn.id !== expectedTurnIds[index])) {
|
|
333
|
-
throw new Error("Codex rollback did not preserve the expected history");
|
|
334
|
-
}
|
|
335
|
-
return { type: "success", newCodexThreadId: forked.threadId };
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export { CodexForkRewindPointNotFoundError as C, ForkSourceMissingError as F, forkCodexThread as a, forkAndTruncateSession as b, ForkTruncateUuidNotFoundError as c, discardForkedSession as d, forkBeforeUserMessage as e, forkSession as f, listCodexRewindPoints as g, forkCodexBeforeUserMessage as h, listClaudeRewindPoints as l };
|
|
206
|
+
export { ForkSourceMissingError as F, forkAndTruncateSession as a, ForkTruncateUuidNotFoundError as b, forkBeforeUserMessage as c, discardForkedSession as d, forkSession as f, listClaudeRewindPoints as l };
|