@outerlayer/cli 0.35.0-next.20261030133755 → 0.35.0

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.
Files changed (120) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/{agent-setup-G445QZEM.js → agent-setup-346QMQY6.js} +5 -5
  3. package/dist/{build-LWGTJ6K3.js → build-HHBTSTE4.js} +6 -6
  4. package/dist/{build-disk-TA5NS2BN.js → build-disk-R6OH6JL5.js} +5 -5
  5. package/dist/build-info.json +1 -1
  6. package/dist/{builder-L6N32DCZ.js → builder-DL6NSVAU.js} +4 -4
  7. package/dist/{caller-QHP5BZOI.js → caller-Q44OIVRR.js} +7 -7
  8. package/dist/{check-ULHNX42A.js → check-W4LSRCMV.js} +35 -34
  9. package/dist/{chunk-PPZ47OB6.js → chunk-3L7OHRDV.js} +1 -1
  10. package/dist/{chunk-XU5BNWX7.js → chunk-4DJZSNVT.js} +1 -1
  11. package/dist/{chunk-XKTZBFAR.js → chunk-4PW2DKHE.js} +315 -27
  12. package/dist/{chunk-VNHBDHX7.js → chunk-7J7HRYZ3.js} +1 -1
  13. package/dist/{chunk-LCR2GOVD.js → chunk-7KAWBQ7V.js} +3 -3
  14. package/dist/{chunk-PILW3YP4.js → chunk-7TTYUY2V.js} +1 -1
  15. package/dist/{chunk-ZI7JENTB.js → chunk-7Y5VW4JG.js} +1 -1
  16. package/dist/{chunk-IALIYKEB.js → chunk-ABGJ67PH.js} +10 -6
  17. package/dist/{chunk-7R655ODT.js → chunk-AF6DQJ5W.js} +1 -1
  18. package/dist/{chunk-SQGD4LYW.js → chunk-ALEUIS35.js} +1 -1
  19. package/dist/{chunk-ECKZ7ZMW.js → chunk-AZJCSBRV.js} +87 -28
  20. package/dist/{chunk-M355QZ4O.js → chunk-BNFFQC3M.js} +7 -7
  21. package/dist/{chunk-MULCOUAU.js → chunk-CPIYKBQ2.js} +4 -4
  22. package/dist/{chunk-ZC6BJ6XE.js → chunk-DH6BDQM4.js} +46 -19
  23. package/dist/{chunk-NOSVP4DO.js → chunk-DOYLWBJJ.js} +3 -3
  24. package/dist/{chunk-Z5Z5NWYF.js → chunk-EK2FNOCD.js} +2 -2
  25. package/dist/{chunk-SHPCVBT3.js → chunk-EZRAR5YG.js} +1 -1
  26. package/dist/{chunk-7YCHMJ7K.js → chunk-FKLGX72N.js} +6 -6
  27. package/dist/{chunk-22TSOZFT.js → chunk-FW3ZQKPY.js} +4 -4
  28. package/dist/{chunk-B2O6FJX7.js → chunk-G2HRULTO.js} +2 -2
  29. package/dist/{chunk-B2IVZ2VJ.js → chunk-GGI3J7WS.js} +103 -22
  30. package/dist/{chunk-54BABLHB.js → chunk-HTQBIXE7.js} +2 -2
  31. package/dist/{chunk-WVWWUVHW.js → chunk-K3Z4Y6VU.js} +3 -3
  32. package/dist/{chunk-J5MONLV2.js → chunk-K5EOLRGJ.js} +3 -3
  33. package/dist/{chunk-LW2A24IA.js → chunk-LGV5N5DG.js} +1 -1
  34. package/dist/{chunk-THF4YBBI.js → chunk-LXAYOMSX.js} +6 -6
  35. package/dist/{chunk-TN4OV3H7.js → chunk-MCMDEEXB.js} +3 -3
  36. package/dist/{receive-files-T2BIUBQL.js → chunk-NN33FYXG.js} +0 -1
  37. package/dist/{chunk-XQXQA446.js → chunk-ODX2XCL3.js} +3 -3
  38. package/dist/{chunk-7SUCHVM6.js → chunk-OS73XDJ7.js} +5 -5
  39. package/dist/{chunk-2RBIAXER.js → chunk-P24VR4H3.js} +2 -2
  40. package/dist/{chunk-NEG4C24O.js → chunk-P4PVRDVY.js} +3 -3
  41. package/dist/{chunk-NZF7CALU.js → chunk-P5CXB7ZT.js} +3 -3
  42. package/dist/{chunk-2F43WNKI.js → chunk-RIHB3HA2.js} +3 -3
  43. package/dist/{chunk-37NRGUIQ.js → chunk-RKDOKIIK.js} +2 -2
  44. package/dist/{chunk-GVYHRPJC.js → chunk-RLFVKOEI.js} +3 -3
  45. package/dist/{chunk-TMIJHMEN.js → chunk-RS2RFWIK.js} +1 -1
  46. package/dist/{chunk-ADWYXR2P.js → chunk-SEY2HTZO.js} +7 -7
  47. package/dist/{chunk-GCSVZGKI.js → chunk-SUVWQPOG.js} +3 -3
  48. package/dist/{chunk-POZ65DAI.js → chunk-USR45QSV.js} +1 -1
  49. package/dist/{chunk-CIPWXGGF.js → chunk-UVQ5C3UP.js} +1 -1
  50. package/dist/{chunk-USQ2ZUSN.js → chunk-VQCUADLI.js} +3 -3
  51. package/dist/{chunk-Y5N7IS4F.js → chunk-VRNAM7WM.js} +10 -10
  52. package/dist/{chunk-AUVJMR3P.js → chunk-WAZJPDR2.js} +1 -1
  53. package/dist/{chunk-YQHUCOUL.js → chunk-WT7J2627.js} +4 -1
  54. package/dist/{chunk-EK7MQ56V.js → chunk-WYGAQVBU.js} +1 -1
  55. package/dist/{chunk-RLAS77FI.js → chunk-WYJUQGCB.js} +3 -3
  56. package/dist/{chunk-GBMTKV5B.js → chunk-YQHEJ5SV.js} +1 -1
  57. package/dist/{claude-launcher-VA3OAA5V.js → claude-launcher-HREPADCN.js} +97 -9
  58. package/dist/{cli-STPFQSGI.js → cli-KQUVZRRG.js} +110 -110
  59. package/dist/{command-UZTCQJAQ.js → command-OHJUJ2WX.js} +24 -23
  60. package/dist/{config-GCPH6DGZ.js → config-EYFLM4WT.js} +6 -6
  61. package/dist/{connect-cmd-Q7GRZKSD.js → connect-cmd-REJ5FEC6.js} +5 -5
  62. package/dist/{container-start-JURQ4GR2.js → container-start-KG3ZLJWU.js} +27 -26
  63. package/dist/{context-show-cmd-44HVXXZJ.js → context-show-cmd-XT3QP5OR.js} +6 -6
  64. package/dist/{control-plane-launch-X2QXGPFW.js → control-plane-launch-PCGH76P5.js} +4 -4
  65. package/dist/{demo-voice-cmd-HA73DEBA.js → demo-voice-cmd-2QE7SQRC.js} +11 -11
  66. package/dist/{dist-YUHKBUBD.js → dist-BARPQSHD.js} +1 -1
  67. package/dist/{docker-7XBRCORA.js → docker-3UKTW4GR.js} +4 -4
  68. package/dist/{doctor-VNTOVFF6.js → doctor-5HY3JA5Y.js} +24 -23
  69. package/dist/{emit-artifact-cmd-OLWISCTW.js → emit-artifact-cmd-26PJDTFU.js} +10 -10
  70. package/dist/{emit-criteria-cmd-HXXNZP55.js → emit-criteria-cmd-6YTFXO3L.js} +7 -7
  71. package/dist/{emit-demo-cmd-WCGUGLWU.js → emit-demo-cmd-OQ7UDDRG.js} +11 -11
  72. package/dist/{emit-finding-cmd-EAASHBSF.js → emit-finding-cmd-NO3FSRHT.js} +7 -7
  73. package/dist/{emit-result-cmd-JB3YNG5V.js → emit-result-cmd-7MSUTXG6.js} +9 -9
  74. package/dist/{emit-step-cmd-LVOXE2LI.js → emit-step-cmd-7PFO7XVA.js} +7 -7
  75. package/dist/{find-unit-TP4HYWZM.js → find-unit-3MED6CPQ.js} +8 -8
  76. package/dist/{findings-cmd-NPRBGBWC.js → findings-cmd-SWAPQUFT.js} +7 -7
  77. package/dist/{fleet-readiness-ZQOFJZ5B.js → fleet-readiness-5RMWZH4V.js} +4 -4
  78. package/dist/{governing-source-D65HNFFP.js → governing-source-INXQEK24.js} +9 -9
  79. package/dist/{hook-fast-OPHM3MRK.js → hook-fast-2KVZZRJN.js} +1 -1
  80. package/dist/{host-checks-JHCU7PBL.js → host-checks-RCWXCCW2.js} +25 -24
  81. package/dist/{pending-2VIIFAP4.js → host-key-O4DFMOSV.js} +2 -2
  82. package/dist/{image-tag-JWATDMIZ.js → image-tag-WBD57QBN.js} +2 -2
  83. package/dist/index.js +4 -4
  84. package/dist/{init-SSTC6YY4.js → init-52F2M54W.js} +20 -19
  85. package/dist/{init-UYPFZV3A.js → init-U5XUDKE7.js} +20 -19
  86. package/dist/{init-cmd-YLS73UEJ.js → init-cmd-WYLANAD5.js} +10 -10
  87. package/dist/{init-update-J7AL65L3.js → init-update-Z2T5J3Z2.js} +9 -9
  88. package/dist/{install-cmd-ZEFBJH24.js → install-cmd-JKPXIOEY.js} +4 -4
  89. package/dist/{logs-3YRC7HRA.js → logs-FEITSC2V.js} +1 -1
  90. package/dist/{loop-XQJY3ZTX.js → loop-WJBFH6XU.js} +34 -33
  91. package/dist/{machine-FLZ6ZM7O.js → machine-KUUTBDAT.js} +20 -19
  92. package/dist/{mcp-serve-cmd-PKXIHUOX.js → mcp-serve-cmd-ZINYSLY6.js} +3 -3
  93. package/dist/{paths-7PC3K7C3.js → paths-XEYE7OZ2.js} +1 -1
  94. package/dist/{host-key-Q5DEAP3Q.js → pending-D2NNV54J.js} +2 -2
  95. package/dist/{pidfile-KQ2EJABZ.js → pidfile-FLFVRKVW.js} +2 -2
  96. package/dist/receive-files-5MBUXAE5.js +6 -0
  97. package/dist/{record-IHEF6C33.js → record-JMZOXD4R.js} +2 -2
  98. package/dist/{runner-env-2FM6I4OS.js → runner-env-2NVOHTRC.js} +8 -8
  99. package/dist/{runner-identity-QTGQJBBB.js → runner-identity-T6YPTHOH.js} +4 -4
  100. package/dist/{runner-key-6XPOLXFF.js → runner-key-WPQGF2L7.js} +20 -19
  101. package/dist/{session-sender-4KJOPWXH.js → session-sender-ADHV7WZ6.js} +10 -10
  102. package/dist/{spec-cmd-NKLZGF34.js → spec-cmd-OUEKA6X3.js} +8 -8
  103. package/dist/{state-FJPSFOID.js → state-UWIM42JH.js} +2 -2
  104. package/dist/{status-M2XPA33H.js → status-2JRATV66.js} +25 -24
  105. package/dist/{sync-cmd-QVHWU4VF.js → sync-cmd-IEPWMYWY.js} +9 -9
  106. package/dist/{update-steps-2ZLRFCHB.js → update-steps-3SRL32IV.js} +26 -25
  107. package/dist/{watch-J6PJHOWO.js → watch-3K3IB443.js} +9 -9
  108. package/dist/{work-claim-cmd-EP74CEYP.js → work-claim-cmd-5ACB2ZWP.js} +13 -13
  109. package/dist/{work-cmd-A3O2XIVJ.js → work-cmd-B6HZW26B.js} +7 -7
  110. package/dist/{work-comment-cmd-AP2ENAHC.js → work-comment-cmd-MBGBBR7V.js} +8 -8
  111. package/dist/{work-demo-cmd-PNZU3OOM.js → work-demo-cmd-RLOS55MP.js} +7 -7
  112. package/dist/{work-logs-cmd-DNOMJ6HT.js → work-logs-cmd-VUICWCEO.js} +7 -7
  113. package/dist/{work-open-pr-cmd-M5ON2YNB.js → work-open-pr-cmd-CYXICEJE.js} +8 -8
  114. package/dist/{work-pr-cmd-34FS6U3C.js → work-pr-cmd-3HSFJO65.js} +7 -7
  115. package/dist/{work-proofs-cmd-UFAIGZZH.js → work-proofs-cmd-NJ4YYQ2V.js} +8 -8
  116. package/dist/{work-proofs-record-QFK57MWS.js → work-proofs-record-NN7XB2QC.js} +14 -14
  117. package/dist/{work-stop-cmd-JSKWIULW.js → work-stop-cmd-QXZSZLEY.js} +7 -7
  118. package/package.json +1 -1
  119. package/skill-pack/maintained/outerlayer-amend/SKILL.md +9 -7
  120. package/skill-pack/maintained/outerlayer-amend/references/earlier-run.md +18 -0
@@ -1,33 +1,33 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-ZI7JENTB.js';
3
+ import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-7Y5VW4JG.js';
4
4
  import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
5
5
  import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
6
- import { reportFailedStart, fitImageBuildMemory } from './chunk-M355QZ4O.js';
7
- import { renderUpdateSteps } from './chunk-GVYHRPJC.js';
8
- import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, readProvisionOut, workdirProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, startSender, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, serveLease, vmAlive, writeGuestGhConfig, ALREADY_RELEASED, inTeardown } from './chunk-B2IVZ2VJ.js';
9
- import { RUNNER_PROTOCOL } from './chunk-TMIJHMEN.js';
10
- import { writeFleetState } from './chunk-LW2A24IA.js';
11
- import { writePendingUpdate } from './chunk-SHPCVBT3.js';
6
+ import { reportFailedStart, fitImageBuildMemory } from './chunk-BNFFQC3M.js';
7
+ import { renderUpdateSteps } from './chunk-RLFVKOEI.js';
8
+ import { releaseLease, isUnfinished, restoreSessionIntoMicroVm, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, readProvisionOut, workdirProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, startSender, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, serveLease, vmAlive, writeGuestGhConfig, ALREADY_RELEASED, inTeardown } from './chunk-GGI3J7WS.js';
9
+ import { RUNNER_PROTOCOL } from './chunk-RS2RFWIK.js';
10
+ import { writeFleetState } from './chunk-LGV5N5DG.js';
11
+ import { writePendingUpdate } from './chunk-EZRAR5YG.js';
12
12
  import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
13
- import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, createHousekeepingDocker, housekeepingDockerIfReachable, KIND_LABEL, RECIPE_KEY_LABEL, askFleetMachine } from './chunk-ADWYXR2P.js';
14
- import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-7R655ODT.js';
13
+ import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, createHousekeepingDocker, housekeepingDockerIfReachable, KIND_LABEL, RECIPE_KEY_LABEL, askFleetMachine } from './chunk-SEY2HTZO.js';
14
+ import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-AF6DQJ5W.js';
15
15
  import { RepoFilter } from './chunk-TBT347UY.js';
16
- import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, itemTag, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, HELPER_ENV, setUpRunnerCgroup, sweepImageBuilders, usableCpus, stoppedHelperReason, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel, selectStaleIncomplete, selectExpired, selectToFit, removeSavedState } from './chunk-XKTZBFAR.js';
17
- import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-AUVJMR3P.js';
16
+ import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, itemTag, prepareResume, restoreSessionIntoContainer, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, HELPER_ENV, setUpRunnerCgroup, sweepImageBuilders, usableCpus, stoppedHelperReason, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel, selectStaleIncomplete, selectExpired, selectToFit, removeSavedState } from './chunk-4PW2DKHE.js';
17
+ import { RUNNER_RESERVE_BYTES } from './chunk-ODX2XCL3.js';
18
+ import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-WAZJPDR2.js';
18
19
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
19
- import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-7SUCHVM6.js';
20
- import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-SQGD4LYW.js';
20
+ import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-OS73XDJ7.js';
21
+ import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-ALEUIS35.js';
21
22
  import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
22
- import { RUNNER_RESERVE_BYTES } from './chunk-XQXQA446.js';
23
- import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls } from './chunk-2RBIAXER.js';
24
- import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-37NRGUIQ.js';
25
- import { allocatedBytes, freeBytes, formatBytes } from './chunk-Z5Z5NWYF.js';
26
- import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, readJobFileChecked } from './chunk-NOSVP4DO.js';
27
- import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-7YCHMJ7K.js';
28
- import { loadHostKey, ensureHostKey, signerFor } from './chunk-XU5BNWX7.js';
23
+ import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls } from './chunk-P24VR4H3.js';
24
+ import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-RKDOKIIK.js';
25
+ import { allocatedBytes, freeBytes, formatBytes } from './chunk-EK2FNOCD.js';
26
+ import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, readJobFileChecked } from './chunk-DOYLWBJJ.js';
27
+ import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-FKLGX72N.js';
28
+ import { loadHostKey, ensureHostKey, signerFor } from './chunk-4DJZSNVT.js';
29
29
  import { resolveVersion } from './chunk-RA3O54FC.js';
30
- import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, storeScopes, imagesDir, spoolDir, orgStoreIn, builderCacheDiskPath, rootfsDir } from './chunk-YQHUCOUL.js';
30
+ import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, storeScopes, imagesDir, spoolDir, orgStoreIn, builderCacheDiskPath, sessionsDir, rootfsDir } from './chunk-WT7J2627.js';
31
31
  import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential, fdName } from './chunk-GANAOCHR.js';
32
32
  import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-MESOOLF4.js';
33
33
  import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync, lstatSync } from 'fs';
@@ -1075,6 +1075,7 @@ async function runHousekeeping(options) {
1075
1075
  }
1076
1076
  freed += await removeSavedStates(options, nowMs, savedStatesDir(root));
1077
1077
  freed += removeStaleBuilderCaches(options, nowMs);
1078
+ freed += removeStaleSessions(options, nowMs);
1078
1079
  for (const scope of storeScopes(options.configPath)) {
1079
1080
  const spoolPath = spoolDir(orgStoreIn(root, scope));
1080
1081
  const spoolFiles = listDir(spoolPath).flatMap((name) => {
@@ -1154,6 +1155,35 @@ async function removeStaleRootDisksIn(root, unfinished, options, docker) {
1154
1155
  }
1155
1156
  return freed;
1156
1157
  }
1158
+ function removeStaleSessions(options, nowMs) {
1159
+ let freed = 0;
1160
+ for (const scope of storeScopes(options.configPath)) {
1161
+ const where = sessionsDir(options.configPath, scope);
1162
+ for (const name of listDir(where)) {
1163
+ const path = join(where, name);
1164
+ const keptAt = Date.parse(readKeptAt(path) ?? "");
1165
+ const sinceMs = Number.isFinite(keptAt) ? keptAt : mtimeOf(path);
1166
+ if (sinceMs === void 0 || nowMs - sinceMs < options.keepDays * 864e5) continue;
1167
+ const size = sizeOf(path);
1168
+ try {
1169
+ rmSync(path, { recursive: true, force: true });
1170
+ freed += size;
1171
+ options.log.line(`housekeeping: removed kept session of work item ${name} (${formatBytes(size)}), kept ${formatDuration(nowMs - sinceMs)} ago`);
1172
+ } catch (err) {
1173
+ options.log.error(`housekeeping: could not remove the kept session of work item ${name}: ${describeCallFailure(err)}`);
1174
+ }
1175
+ }
1176
+ }
1177
+ return freed;
1178
+ }
1179
+ function readKeptAt(dir) {
1180
+ try {
1181
+ const parsed = JSON.parse(readFileSync(join(dir, "meta.json"), "utf8"));
1182
+ return typeof parsed.keptAt === "string" ? parsed.keptAt : void 0;
1183
+ } catch {
1184
+ return void 0;
1185
+ }
1186
+ }
1157
1187
  function removeStaleBuilderCaches(options, nowMs) {
1158
1188
  let freed = 0;
1159
1189
  for (const scope of storeScopes(options.configPath)) {
@@ -2412,7 +2442,7 @@ var CLAIM_REFUSAL_CODES = new Set(
2412
2442
  "pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
2413
2443
  );
2414
2444
  async function tryClaimAndStart(state, item, queue) {
2415
- const { postJson: postJson2 } = await import('./work-cmd-A3O2XIVJ.js');
2445
+ const { postJson: postJson2 } = await import('./work-cmd-B6HZW26B.js');
2416
2446
  const log = logOf(state);
2417
2447
  const hostKey = await loadHostKey(state.config.configPath);
2418
2448
  const claim = await retrySend(
@@ -2577,6 +2607,31 @@ function wasExtended(claim) {
2577
2607
  if (!Number.isFinite(createdAtMs) || !Number.isFinite(expiresAtMs)) return false;
2578
2608
  return expiresAtMs - createdAtMs > LEASE_SECONDS * 1e3 + 2e3;
2579
2609
  }
2610
+ async function prepareSession(state, active, item, queue, tag) {
2611
+ const job = active.job;
2612
+ const builtin = job.microvm !== void 0 || job.container !== void 0;
2613
+ const log = logOf(state);
2614
+ try {
2615
+ const prepared = await prepareResume({
2616
+ configPath: state.config.configPath,
2617
+ organizationId: job.organizationId,
2618
+ workItemId: item.id,
2619
+ queue,
2620
+ builtin,
2621
+ restore: async ({ dir, meta }) => {
2622
+ if (job.microvm !== void 0) await restoreSessionIntoMicroVm(runtimeOf(state), job.microvm, dir, meta);
2623
+ else if (job.container !== void 0) await restoreSessionIntoContainer(runtimeOf(state), job.container, dir, meta);
2624
+ },
2625
+ log: (line) => log.line(`${tag} ${line}`)
2626
+ });
2627
+ active.job = { ...job, ...builtin ? { sessionId: prepared.sessionId } : {}, resume: prepared.resume };
2628
+ writeJobFile(join(active.dirPath, "job.json"), active.job);
2629
+ return builtin ? prepared.env : void 0;
2630
+ } catch (err) {
2631
+ log.error(`${tag} no session is set for the agent command: ${describeCallFailure(err)} \xB7 continuing`);
2632
+ return void 0;
2633
+ }
2634
+ }
2580
2635
  async function startJob(state, item, queue, claimId, itemKey, branch, identity, claimed, fleet) {
2581
2636
  const log = logOf(state);
2582
2637
  const startedAt = nowOf(state);
@@ -2594,7 +2649,9 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2594
2649
  itemKey,
2595
2650
  branch,
2596
2651
  commitIdentity: identity,
2597
- ...fleet === void 0 ? {} : { workItemId: fleet.workItemId, appId: fleet.appId, organizationId: fleet.organizationId, size: fleet.size },
2652
+ // The work item the kept session belongs to. A fleet claim names it too, from the same listing.
2653
+ workItemId: item.id,
2654
+ ...fleet === void 0 ? {} : { appId: fleet.appId, organizationId: fleet.organizationId, size: fleet.size },
2598
2655
  ...primary === void 0 ? {} : { repository: primary.repository, repositories },
2599
2656
  startedAt: startedAt.toISOString()
2600
2657
  };
@@ -2972,6 +3029,8 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2972
3029
  await endJob(state, active, "failed", { stage: "command" });
2973
3030
  return;
2974
3031
  }
3032
+ const sessionEnv = await prepareSession(state, active, item, queue, tag);
3033
+ job = active.job;
2975
3034
  let running;
2976
3035
  try {
2977
3036
  if (job.microvm !== void 0) {
@@ -2981,14 +3040,14 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2981
3040
  job.microvm.commandDir = MICROVM_COMMAND_DIR;
2982
3041
  job.microvm.commandLogBase = commandLogOffset(dirPath, 0);
2983
3042
  writeJobFile(jobFilePath, job);
2984
- await startMicroVmCommand({ job, jobDir: dirPath, cmdline, runtime, config: state.config });
3043
+ await startMicroVmCommand({ job, jobDir: dirPath, cmdline, runtime, config: state.config, extraEnv: sessionEnv });
2985
3044
  } else {
2986
- const composed = microVmCommandLine({ job, jobDir: dirPath, cmdline, runtime, config: state.config, cli: join(runtime.cliBuild().distDir, "index.js") });
3045
+ const composed = microVmCommandLine({ job, jobDir: dirPath, cmdline, runtime, config: state.config, cli: join(runtime.cliBuild().distDir, "index.js"), extraEnv: sessionEnv });
2987
3046
  running = runCommand(composed.line, { ...composed.env, OUTERLAYER_JOB_DIR: dirPath }, dirPath, join(dirPath, "command.log"), state.deps.spawnFn);
2988
3047
  }
2989
3048
  } else if (job.container !== void 0) {
2990
3049
  const runtime = runtimeOf(state);
2991
- const exec = containerCommandExec({ job, cmdline, runtime, config: state.config });
3050
+ const exec = containerCommandExec({ job, cmdline, runtime, config: state.config, extraEnv: sessionEnv });
2992
3051
  job.container.tracking = "container";
2993
3052
  job.container.commandLogBase = commandLogOffset(dirPath, 0);
2994
3053
  writeJobFile(jobFilePath, job);
@@ -3754,7 +3813,7 @@ async function startRunner(configPath, deps, startup) {
3754
3813
  check: update.check ? () => update.check(configPath) : async () => {
3755
3814
  const held = heldClaudeCredential();
3756
3815
  const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
3757
- return (await import('./check-ULHNX42A.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3816
+ return (await import('./check-W4LSRCMV.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3758
3817
  },
3759
3818
  now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
3760
3819
  log
@@ -4136,4 +4195,4 @@ function runnerProcessState(configPath) {
4136
4195
  return isSameProcess(entry.pid, entry.start) ? { state: "running", pid: entry.pid } : { state: "stale", pid: entry.pid };
4137
4196
  }
4138
4197
 
4139
- export { RunnerStartError, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
4198
+ export { RunnerStartError, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, prepareSession, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { scrubReason, stripTerminalControls } from './chunk-B2IVZ2VJ.js';
4
- import { RunnerAlreadyRunningError, readPidFile } from './chunk-AUVJMR3P.js';
3
+ import { scrubReason, stripTerminalControls } from './chunk-GGI3J7WS.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-ODX2XCL3.js';
5
+ import { RunnerAlreadyRunningError, readPidFile } from './chunk-WAZJPDR2.js';
5
6
  import { isSameProcess } from './chunk-JBJTC3UU.js';
6
- import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-XQXQA446.js';
7
- import { keyRunnerFactory } from './chunk-37NRGUIQ.js';
8
- import { isSignatureRefusal, postJson } from './chunk-7YCHMJ7K.js';
9
- import { signerFor } from './chunk-XU5BNWX7.js';
10
- import { pidFilePath } from './chunk-YQHUCOUL.js';
7
+ import { keyRunnerFactory } from './chunk-RKDOKIIK.js';
8
+ import { isSignatureRefusal, postJson } from './chunk-FKLGX72N.js';
9
+ import { signerFor } from './chunk-4DJZSNVT.js';
10
+ import { pidFilePath } from './chunk-WT7J2627.js';
11
11
  import { readFileSync } from 'fs';
12
12
 
13
13
  createRequire(import.meta.url);
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { staleBuildRefusal, staleBuildWarning, detectCi } from './chunk-IALIYKEB.js';
3
+ import { staleBuildRefusal, staleBuildWarning, detectCi } from './chunk-ABGJ67PH.js';
4
4
  import { launchRefusalForSession } from './chunk-AAGU5FJF.js';
5
5
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
6
- import { autoConnect } from './chunk-NZF7CALU.js';
6
+ import { autoConnect } from './chunk-P5CXB7ZT.js';
7
7
  import { C } from './chunk-2AM6Z5BP.js';
8
8
  import { readEffectiveArtifactSpoolState, localArtifactIds, isArtifactTombstoned, artifactBlobsDir, appendArtifactRecord, artifactsSpoolPath, findPendingArtifactRecord, sanitizeTerminal, appendArtifactTombstone } from './chunk-XSX42Q2H.js';
9
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-GBMTKV5B.js';
10
- import { resolveRepoIdentity } from './chunk-ZC6BJ6XE.js';
9
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-YQHEJ5SV.js';
10
+ import { resolveRepoIdentity } from './chunk-DH6BDQM4.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
12
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
13
13
  import { ARTIFACT_MAX_CAPTION_LENGTH, ArtifactCriterionIdSchema, ARTIFACT_MAX_BYTES, ARTIFACT_MAX_FILENAME_LENGTH, mediaTypeForArtifactPath, inferArtifactKind, ARTIFACT_MAX_REPLACES_TARGETS, parseTestSelector, parseJunit, bindTests } from './chunk-N2XW4NYY.js';
@@ -69684,12 +69684,14 @@ var KNOWN_UNMAPPED = /* @__PURE__ */ new Set([
69684
69684
  "agent-name"
69685
69685
  ]);
69686
69686
  function parseTranscript(content, opts = {}) {
69687
- var _a5, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
69687
+ var _a5, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
69688
69688
  const warnings = new WarningCollector();
69689
69689
  const versions = /* @__PURE__ */ new Set();
69690
69690
  const lines = content.split("\n");
69691
69691
  const stats = { lines: 0, parsed: 0, skipped: 0, unmapped: 0 };
69692
- let sessionId = "";
69692
+ let sessionId = (_b = (_a5 = opts.fork) == null ? void 0 : _a5.sessionId) != null ? _b : "";
69693
+ const forkLaunchedMs = opts.fork === void 0 ? void 0 : Date.parse(opts.fork.launchedAt);
69694
+ let forkKept = false;
69693
69695
  let cwd;
69694
69696
  let gitBranch;
69695
69697
  const cwdHistogram = /* @__PURE__ */ new Map();
@@ -69781,11 +69783,17 @@ function parseTranscript(content, opts = {}) {
69781
69783
  stats.skipped += 1;
69782
69784
  continue;
69783
69785
  }
69786
+ if (opts.fork !== void 0) {
69787
+ const at = typeof line.timestamp === "string" ? Date.parse(line.timestamp) : Number.NaN;
69788
+ const copied = Number.isFinite(at) && forkLaunchedMs !== void 0 && Number.isFinite(forkLaunchedMs) && at < forkLaunchedMs || !Number.isFinite(at) && !forkKept;
69789
+ if (copied) continue;
69790
+ if (Number.isFinite(at)) forkKept = true;
69791
+ }
69784
69792
  stats.parsed += 1;
69785
69793
  if (typeof line.sessionId === "string" && !sessionId) sessionId = line.sessionId;
69786
69794
  if (typeof line.cwd === "string" && !cwd) cwd = line.cwd;
69787
69795
  if (typeof line.cwd === "string" && (cwdHistogram.has(line.cwd) || cwdHistogram.size < 32)) {
69788
- cwdHistogram.set(line.cwd, ((_a5 = cwdHistogram.get(line.cwd)) != null ? _a5 : 0) + 1);
69796
+ cwdHistogram.set(line.cwd, ((_c = cwdHistogram.get(line.cwd)) != null ? _c : 0) + 1);
69789
69797
  }
69790
69798
  if (typeof line.gitBranch === "string" && !gitBranch) gitBranch = line.gitBranch;
69791
69799
  if (typeof line.entrypoint === "string" && !entrypoint) entrypoint = line.entrypoint;
@@ -69801,7 +69809,7 @@ function parseTranscript(content, opts = {}) {
69801
69809
  const tsIso = noteTs(line.timestamp);
69802
69810
  if (typeof line.attributionSkill === "string") {
69803
69811
  if (line.attributionSkill !== attributedSkill) {
69804
- const msgId = typeof ((_b = line.message) == null ? void 0 : _b.id) === "string" ? line.message.id : (_c = line.uuid) != null ? _c : `line-${i}`;
69812
+ const msgId = typeof ((_d = line.message) == null ? void 0 : _d.id) === "string" ? line.message.id : (_e = line.uuid) != null ? _e : `line-${i}`;
69805
69813
  const activationTurnIndex = line.type === "assistant" && open22 !== null && open22.messageId !== msgId ? turnIndex + 1 : turnIndex;
69806
69814
  events.push({
69807
69815
  type: EVENT_TYPES.skillActivated,
@@ -69820,7 +69828,7 @@ function parseTranscript(content, opts = {}) {
69820
69828
  switch (line.type) {
69821
69829
  case "assistant": {
69822
69830
  if (line.isApiErrorMessage === true) {
69823
- const code = apiErrorCode((_d = line.message) == null ? void 0 : _d.content);
69831
+ const code = apiErrorCode((_f = line.message) == null ? void 0 : _f.content);
69824
69832
  events.push({
69825
69833
  type: EVENT_TYPES.apiError,
69826
69834
  seq: seq++,
@@ -69828,7 +69836,7 @@ function parseTranscript(content, opts = {}) {
69828
69836
  ...code ? { data: { code } } : {}
69829
69837
  });
69830
69838
  }
69831
- const msgId = typeof ((_e = line.message) == null ? void 0 : _e.id) === "string" ? line.message.id : (_f = line.uuid) != null ? _f : `line-${i}`;
69839
+ const msgId = typeof ((_g = line.message) == null ? void 0 : _g.id) === "string" ? line.message.id : (_h = line.uuid) != null ? _h : `line-${i}`;
69832
69840
  if (open22 && open22.messageId !== msgId) flushOpen();
69833
69841
  if (!open22) {
69834
69842
  open22 = {
@@ -69846,7 +69854,7 @@ function parseTranscript(content, opts = {}) {
69846
69854
  case "user": {
69847
69855
  flushOpen();
69848
69856
  if (line.isCompactSummary === true) {
69849
- if (((_g = events[events.length - 1]) == null ? void 0 : _g.type) !== EVENT_TYPES.compaction) {
69857
+ if (((_i = events[events.length - 1]) == null ? void 0 : _i.type) !== EVENT_TYPES.compaction) {
69850
69858
  events.push({ type: EVENT_TYPES.compaction, seq: seq++, ...tsIso ? { ts: tsIso } : {} });
69851
69859
  }
69852
69860
  break;
@@ -69872,7 +69880,7 @@ function parseTranscript(content, opts = {}) {
69872
69880
  break;
69873
69881
  case "mode":
69874
69882
  case "permission-mode":
69875
- events.push({ type: EVENT_TYPES.permissionModeChanged, seq: seq++, ...tsIso ? { ts: tsIso } : {}, data: { mode: (_i = (_h = line.permissionMode) != null ? _h : line.mode) != null ? _i : "unknown" } });
69883
+ events.push({ type: EVENT_TYPES.permissionModeChanged, seq: seq++, ...tsIso ? { ts: tsIso } : {}, data: { mode: (_k = (_j = line.permissionMode) != null ? _j : line.mode) != null ? _k : "unknown" } });
69876
69884
  break;
69877
69885
  case "pr-link":
69878
69886
  events.push({ type: EVENT_TYPES.prLinked, seq: seq++, ...tsIso ? { ts: tsIso } : {}, ...typeof line.prNumber === "number" ? { data: { prNumber: line.prNumber } } : {} });
@@ -69881,12 +69889,12 @@ function parseTranscript(content, opts = {}) {
69881
69889
  handleSystem(line, tsIso, events, () => seq++, (ms) => {
69882
69890
  wallClockMs += ms;
69883
69891
  });
69884
- if (line.isCompactSummary === true && ((_j = events[events.length - 1]) == null ? void 0 : _j.type) !== EVENT_TYPES.compaction) {
69892
+ if (line.isCompactSummary === true && ((_l = events[events.length - 1]) == null ? void 0 : _l.type) !== EVENT_TYPES.compaction) {
69885
69893
  events.push({ type: EVENT_TYPES.compaction, seq: seq++, ...tsIso ? { ts: tsIso } : {} });
69886
69894
  }
69887
69895
  break;
69888
69896
  case "attachment":
69889
- if (((_k = line.attachment) == null ? void 0 : _k.type) === "hook_blocking_error") {
69897
+ if (((_m = line.attachment) == null ? void 0 : _m.type) === "hook_blocking_error") {
69890
69898
  events.push({
69891
69899
  type: EVENT_TYPES.hookBlocked,
69892
69900
  seq: seq++,
@@ -69908,7 +69916,7 @@ function parseTranscript(content, opts = {}) {
69908
69916
  break;
69909
69917
  default:
69910
69918
  if (line.isCompactSummary === true) {
69911
- if (((_l = events[events.length - 1]) == null ? void 0 : _l.type) !== EVENT_TYPES.compaction) {
69919
+ if (((_n = events[events.length - 1]) == null ? void 0 : _n.type) !== EVENT_TYPES.compaction) {
69912
69920
  events.push({ type: EVENT_TYPES.compaction, seq: seq++, ...tsIso ? { ts: tsIso } : {} });
69913
69921
  }
69914
69922
  } else {
@@ -69930,7 +69938,7 @@ function parseTranscript(content, opts = {}) {
69930
69938
  }
69931
69939
  if (typeof line.prUrl === "string") entry.prUrl = line.prUrl;
69932
69940
  if (shas.pending.length > 0) {
69933
- entry.commitShas = [...(_m = entry.commitShas) != null ? _m : [], ...shas.pending];
69941
+ entry.commitShas = [...(_o = entry.commitShas) != null ? _o : [], ...shas.pending];
69934
69942
  shas.pending = [];
69935
69943
  }
69936
69944
  }
@@ -69951,10 +69959,10 @@ function parseTranscript(content, opts = {}) {
69951
69959
  }
69952
69960
  if (!title && opts.isSubagent) {
69953
69961
  const firstTurn = turns.find((t) => t.role === "user" && typeof t.text === "string" && t.text.trim());
69954
- const text = (_n = firstTurn == null ? void 0 : firstTurn.text) == null ? void 0 : _n.trim();
69962
+ const text = (_p = firstTurn == null ? void 0 : firstTurn.text) == null ? void 0 : _p.trim();
69955
69963
  const spawnTag = text ? /^<teammate-message([^>]*)>/.exec(text) : null;
69956
69964
  if (spawnTag) {
69957
- const summary = (_p = (_o = /\bsummary="([^"]*)"/.exec(spawnTag[1])) == null ? void 0 : _o[1]) == null ? void 0 : _p.trim();
69965
+ const summary = (_r = (_q = /\bsummary="([^"]*)"/.exec(spawnTag[1])) == null ? void 0 : _q[1]) == null ? void 0 : _r.trim();
69958
69966
  if (summary) {
69959
69967
  title = decodeXmlEntities(summary);
69960
69968
  } else {
@@ -69976,7 +69984,7 @@ function parseTranscript(content, opts = {}) {
69976
69984
  const session = {
69977
69985
  schemaVersion: SCHEMA_VERSION,
69978
69986
  id: ownId,
69979
- agent: { type: (_q = opts.agentType) != null ? _q : "claude-code", ...version2 ? { version: version2 } : {}, ...entrypoint ? { entrypoint } : {}, origin },
69987
+ agent: { type: (_s = opts.agentType) != null ? _s : "claude-code", ...version2 ? { version: version2 } : {}, ...entrypoint ? { entrypoint } : {}, origin },
69980
69988
  env: { ...cwd ? { cwd } : {}, ...{}, ...gitBranch ? { gitBranch } : {} },
69981
69989
  ...opts.isSubagent ? {
69982
69990
  subagent: {
@@ -70011,7 +70019,7 @@ function parseTranscript(content, opts = {}) {
70011
70019
  } : {},
70012
70020
  ...title ? { title } : {},
70013
70021
  ...Object.keys(vendor).length > 0 ? { vendor } : {},
70014
- captureTier: (_r = opts.captureTier) != null ? _r : "full",
70022
+ captureTier: (_t = opts.captureTier) != null ? _t : "full",
70015
70023
  warnings: warnings.toArray(),
70016
70024
  // CAPTURE-INTERNAL: consumed by `enrichSessionRepo` to attribute the
70017
70025
  // session to where the work happened, then deleted before the session is
@@ -70584,6 +70592,24 @@ function countLines(s) {
70584
70592
  for (let i = 0; i < s.length; i++) if (s[i] === "\n") n++;
70585
70593
  return n;
70586
70594
  }
70595
+ function readForkRecord(home) {
70596
+ try {
70597
+ const parsed = JSON.parse(readFileSync(join(home, ".outerlayer", "resume", "launch.json"), "utf8"));
70598
+ if (typeof parsed.sessionId === "string" && parsed.sessionId !== "" && typeof parsed.launchedAt === "string" && Number.isFinite(Date.parse(parsed.launchedAt))) {
70599
+ return { sessionId: parsed.sessionId, launchedAt: parsed.launchedAt };
70600
+ }
70601
+ } catch {
70602
+ }
70603
+ return void 0;
70604
+ }
70605
+ function forkFor(record2, file2) {
70606
+ if (record2 === void 0) return void 0;
70607
+ return file2.sessionId === record2.sessionId || file2.parentSessionId === record2.sessionId ? record2 : void 0;
70608
+ }
70609
+ function forkOptions(record2, entry) {
70610
+ const fork = forkFor(record2, { sessionId: sessionIdFromPath(entry.file), parentSessionId: entry.parentSessionId });
70611
+ return fork === void 0 ? {} : { fork };
70612
+ }
70587
70613
  var claudeCodeAdapter = {
70588
70614
  id: "claude-code",
70589
70615
  discover(roots) {
@@ -70609,7 +70635,8 @@ var claudeCodeAdapter = {
70609
70635
  ...entry.metaDescription ? { spawnDescription: entry.metaDescription } : {},
70610
70636
  ...entry.metaName ? { spawnName: entry.metaName } : {},
70611
70637
  ...entry.metaAgentType ? { spawnAgentType: entry.metaAgentType } : {},
70612
- ...opts.captureTier ? { captureTier: opts.captureTier } : {}
70638
+ ...opts.captureTier ? { captureTier: opts.captureTier } : {},
70639
+ ...forkOptions(opts.fork, entry)
70613
70640
  });
70614
70641
  if (!entry.isSubagent && result.session) {
70615
70642
  result.session = applySubagentCommitRollup(result.session, entry.file, entry.altFile);
@@ -71293,7 +71320,7 @@ function scanAll(opts = {}) {
71293
71320
  for (const { entry, adapter } of candidates) {
71294
71321
  let result;
71295
71322
  try {
71296
- result = adapter.parse(entry, { roots, ...opts.captureTier ? { captureTier: opts.captureTier } : {} });
71323
+ result = adapter.parse(entry, { roots, ...opts.captureTier ? { captureTier: opts.captureTier } : {}, ...opts.fork ? { fork: opts.fork } : {} });
71297
71324
  } catch {
71298
71325
  skippedEmpty += 1;
71299
71326
  continue;
@@ -71935,4 +71962,4 @@ chokidar/index.js:
71935
71962
  (*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) *)
71936
71963
  */
71937
71964
 
71938
- export { CaptureDaemon, MIN_SCRUBBED_LITERAL, PRICE_TABLE_SOURCE, SECRET_PATTERNS, SOURCE_ADAPTERS, SUPPORTED_VERSIONS, StatuslineAggregator, WARNING_CODES, claudeCodeAdapter, codexAdapter, codexSessionIdFromPath, compareVersions, completePrefix, computeStatuslineState, costOfUsage, cursorAdapter, cursorChatIdFromPath, defaultCodexSessionsDir, defaultCursorChatsDir, defaultCursorProjectsDir, defaultProjectsDir, defaultRawDir, enrichSessionRepo, findCodexRollouts, findCursorChats, findTranscripts, isNewerThanSupported, isPriceKnown, normalizeErrorSignature, normalizeRemote, parseCodexRollout, parseCursorChat, parseTranscript, readStatuslineState, readSyncWatermarkMs, remoteLookupFailed, resolvePrice, resolveRepoIdentity, rootChildIds, scanAll, scrubDeep, scrubText, sessionIdFromPath, setCustomScrubbers, setLocalIdentity, setRepoRoot, statuslineStatePath, tailTranscript, workspacesByHash, writeStatuslineState };
71965
+ export { CaptureDaemon, MIN_SCRUBBED_LITERAL, PRICE_TABLE_SOURCE, SECRET_PATTERNS, SOURCE_ADAPTERS, SUPPORTED_VERSIONS, StatuslineAggregator, WARNING_CODES, claudeCodeAdapter, codexAdapter, codexSessionIdFromPath, compareVersions, completePrefix, computeStatuslineState, costOfUsage, cursorAdapter, cursorChatIdFromPath, defaultCodexSessionsDir, defaultCursorChatsDir, defaultCursorProjectsDir, defaultProjectsDir, defaultRawDir, enrichSessionRepo, findCodexRollouts, findCursorChats, findTranscripts, forkFor, isNewerThanSupported, isPriceKnown, normalizeErrorSignature, normalizeRemote, parseCodexRollout, parseCursorChat, parseTranscript, readForkRecord, readStatuslineState, readSyncWatermarkMs, remoteLookupFailed, resolvePrice, resolveRepoIdentity, rootChildIds, scanAll, scrubDeep, scrubText, sessionIdFromPath, setCustomScrubbers, setLocalIdentity, setRepoRoot, statuslineStatePath, tailTranscript, workspacesByHash, writeStatuslineState };
@@ -2,9 +2,9 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-TV5ITSVY.js';
4
4
  import { universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-7SO2VHTQ.js';
5
- import { ensureHostKey } from './chunk-XU5BNWX7.js';
6
- import { compareVersions } from './chunk-ZC6BJ6XE.js';
7
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-YQHUCOUL.js';
5
+ import { ensureHostKey } from './chunk-4DJZSNVT.js';
6
+ import { compareVersions } from './chunk-DH6BDQM4.js';
7
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-WT7J2627.js';
8
8
  import { CLAUDE_PORT, BUILD_HOME, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-GANAOCHR.js';
9
9
  import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-MESOOLF4.js';
10
10
  import { createHash } from 'crypto';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-NOSVP4DO.js';
4
- import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-YQHUCOUL.js';
3
+ import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-DOYLWBJJ.js';
4
+ import { buildsDir, storeScopes, rootfsDir, orgStoreIn, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-WT7J2627.js';
5
5
  import { spawnSync } from 'child_process';
6
6
  import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
7
7
  import { dirname, join } from 'path';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-YQHUCOUL.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-WT7J2627.js';
4
4
  import { readFileSync, existsSync, rmSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-NZF7CALU.js';
5
- import { workPageUrl } from './chunk-54BABLHB.js';
4
+ import { autoConnect } from './chunk-P5CXB7ZT.js';
5
+ import { workPageUrl } from './chunk-HTQBIXE7.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
7
7
  import { sanitizeTerminal } from './chunk-XSX42Q2H.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-GBMTKV5B.js';
9
- import { signRunnerRequest } from './chunk-XU5BNWX7.js';
8
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-YQHEJ5SV.js';
9
+ import { signRunnerRequest } from './chunk-4DJZSNVT.js';
10
10
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
11
- import { resolveRepoIdentity } from './chunk-ZC6BJ6XE.js';
11
+ import { resolveRepoIdentity } from './chunk-DH6BDQM4.js';
12
12
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
13
13
  import { homeFromEnv } from './chunk-352DHUTP.js';
14
14
 
@@ -473,7 +473,7 @@ async function runWorkLinkSession(opts) {
473
473
  return await linkSession(opts);
474
474
  } catch (err) {
475
475
  if (opts.logFailures) {
476
- const { logHookError } = await import('./hook-fast-OPHM3MRK.js');
476
+ const { logHookError } = await import('./hook-fast-2KVZZRJN.js');
477
477
  const reason = err instanceof Error ? err.message : String(err);
478
478
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
479
479
  }
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { readNewestDemo } from './chunk-ER6KQCVJ.js';
4
- import { runEmitArtifact } from './chunk-MULCOUAU.js';
4
+ import { runEmitArtifact } from './chunk-CPIYKBQ2.js';
5
5
  import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
6
6
  import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-7SO2VHTQ.js';
7
7
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
8
- import { autoConnect } from './chunk-NZF7CALU.js';
8
+ import { autoConnect } from './chunk-P5CXB7ZT.js';
9
9
  import { C } from './chunk-2AM6Z5BP.js';
10
- import { defaultFetch, resolveGatewayCredentials } from './chunk-GBMTKV5B.js';
11
- import { resolveRepoIdentity } from './chunk-ZC6BJ6XE.js';
10
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-YQHEJ5SV.js';
11
+ import { resolveRepoIdentity } from './chunk-DH6BDQM4.js';
12
12
  import { launchedItemForSession } from './chunk-5WYT3PPE.js';
13
13
  import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DEMO_MANIFEST_LATEST_VERSION, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-N2XW4NYY.js';
14
14
  import { homeFromEnv } from './chunk-352DHUTP.js';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_UNIT_NAME } from './chunk-XQXQA446.js';
4
- import { RUNNER_FILE_MODE } from './chunk-YQHUCOUL.js';
3
+ import { DEFAULT_UNIT_NAME } from './chunk-ODX2XCL3.js';
4
+ import { RUNNER_FILE_MODE } from './chunk-WT7J2627.js';
5
5
  import { claudeEnvPath, withoutCredentialLines, parseRunnerEnv } from './chunk-GANAOCHR.js';
6
6
  import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
7
7
  import { join, dirname } from 'path';