@outerlayer/cli 0.38.0-next.20261109143949 → 0.38.0-next.20261110130701

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 (203) hide show
  1. package/README.md +20 -3
  2. package/dist/agent-setup-GZBGCV3K.js +40 -0
  3. package/dist/{agent-subcommand-DCOPM2NX.js → agent-subcommand-5PNHUNZZ.js} +5 -5
  4. package/dist/{artifact-link-cmd-RUGAK5EX.js → artifact-link-cmd-XOFZP7U5.js} +2 -2
  5. package/dist/{bridge-HZRJYECQ.js → bridge-RNM7OWRW.js} +8 -8
  6. package/dist/{build-3LXKCCJF.js → build-VKO7IVOQ.js} +14 -14
  7. package/dist/{build-disk-TYX6DU5R.js → build-disk-M2JYJF6R.js} +12 -12
  8. package/dist/build-info.json +1 -1
  9. package/dist/{builder-VYKWHAUQ.js → builder-HMHJ6U7C.js} +11 -11
  10. package/dist/caller-U26SATTV.js +23 -0
  11. package/dist/{check-YUKNUSAS.js → check-SJCTNS7N.js} +60 -60
  12. package/dist/{chunk-5OBQBINA.js → chunk-2TXYQANG.js} +1 -1
  13. package/dist/{chunk-6EN72I2O.js → chunk-2WNJ2MHD.js} +1 -1
  14. package/dist/{chunk-F3MEL6B6.js → chunk-3DY4DQOC.js} +5 -5
  15. package/dist/{chunk-LYWLBZ37.js → chunk-3GTAPQBG.js} +2 -2
  16. package/dist/{chunk-U463IFDK.js → chunk-3HJK7WTM.js} +8 -8
  17. package/dist/{chunk-O4Q7GPKU.js → chunk-3W5JLANR.js} +3 -3
  18. package/dist/{chunk-22QIA7SH.js → chunk-47JRSV6Y.js} +1 -1
  19. package/dist/{chunk-RVDXHF2M.js → chunk-4EJHQYVI.js} +255 -50
  20. package/dist/{chunk-KX4JKW4Z.js → chunk-5QDHJT73.js} +7 -4
  21. package/dist/{chunk-X45WDWSV.js → chunk-5QFFQCSY.js} +1 -1
  22. package/dist/{chunk-HGWDBTQ3.js → chunk-6RQP5GP5.js} +3 -3
  23. package/dist/{chunk-5TZCV6JB.js → chunk-6XMC6R4W.js} +1 -1
  24. package/dist/{chunk-T63WTVGY.js → chunk-6XROZIV6.js} +8 -8
  25. package/dist/{chunk-GECHL3NC.js → chunk-72LXVD4O.js} +4 -4
  26. package/dist/{chunk-C3K54KRU.js → chunk-735C5J6Q.js} +7 -7
  27. package/dist/{chunk-JMWCPEKP.js → chunk-7E55P2NR.js} +2 -2
  28. package/dist/{chunk-LO3PSFNT.js → chunk-AC6DM3S3.js} +1 -1
  29. package/dist/{chunk-JAURZKSE.js → chunk-ALCZ2SEW.js} +5 -5
  30. package/dist/{chunk-HUP2CGX4.js → chunk-AS4NMHJM.js} +3 -3
  31. package/dist/{chunk-CDDED64E.js → chunk-ATEMEVFF.js} +1 -1
  32. package/dist/{chunk-RMXRQ3OC.js → chunk-ATQHPT3B.js} +1 -1
  33. package/dist/{chunk-7TM2E4RI.js → chunk-B4U5XI4F.js} +69 -9
  34. package/dist/{chunk-2DVQHK37.js → chunk-B5Z4VA4Q.js} +1 -1
  35. package/dist/{chunk-LIH6CIVB.js → chunk-BCQFMAGM.js} +3 -3
  36. package/dist/{chunk-LIMJRKIU.js → chunk-BTH6HTE5.js} +5 -5
  37. package/dist/{chunk-WGC7UFRM.js → chunk-C2PZOLN7.js} +3 -2
  38. package/dist/{chunk-IG5ZZG7R.js → chunk-C574RHGN.js} +3 -3
  39. package/dist/{chunk-4LUHKCDO.js → chunk-CXXQQST7.js} +26 -15
  40. package/dist/{chunk-4K2EMRJP.js → chunk-DKDBMMX7.js} +6 -6
  41. package/dist/{chunk-DX27B42J.js → chunk-EHPKACA7.js} +1 -1
  42. package/dist/{chunk-RVYMYTXX.js → chunk-ENHD5PNW.js} +1 -1
  43. package/dist/{chunk-EGKYININ.js → chunk-F2ADK2KB.js} +5 -5
  44. package/dist/{chunk-GVK7AKFX.js → chunk-FGBBGUM4.js} +10 -8
  45. package/dist/{chunk-HE53NIRE.js → chunk-FXVHF6RX.js} +54 -4
  46. package/dist/{chunk-H3YHAO7L.js → chunk-GJMLLXZJ.js} +1 -1
  47. package/dist/{chunk-4EQQS3VJ.js → chunk-HDEYRLWK.js} +1 -1
  48. package/dist/{chunk-G7HNRAXN.js → chunk-HJK2KI3Q.js} +16 -16
  49. package/dist/{chunk-2J3X2Z4F.js → chunk-I2N427GS.js} +8 -8
  50. package/dist/{chunk-NFZMENCY.js → chunk-I45HTSSA.js} +1 -1
  51. package/dist/{chunk-2XEQCSCQ.js → chunk-IGO766M6.js} +4 -4
  52. package/dist/{chunk-TNAUQADA.js → chunk-ITOIM3WV.js} +1 -1
  53. package/dist/{chunk-CCEP5WBI.js → chunk-IVB6A3I7.js} +13 -11
  54. package/dist/{chunk-SLR6QAOE.js → chunk-L32O52SH.js} +1 -1
  55. package/dist/{chunk-TTG6Y7G7.js → chunk-L6CZTRNW.js} +2 -2
  56. package/dist/{chunk-4OD45RBP.js → chunk-LGJ56FCM.js} +11 -2
  57. package/dist/{chunk-N2QYP3NQ.js → chunk-MBPBYMHU.js} +565 -16
  58. package/dist/{chunk-X56UUEHE.js → chunk-MSARYPFD.js} +12 -3
  59. package/dist/{chunk-OKELGJNN.js → chunk-MT4XF5OL.js} +3 -3
  60. package/dist/{chunk-QP6SPQU5.js → chunk-NE7EG3SN.js} +6 -6
  61. package/dist/{chunk-JKRVSEK7.js → chunk-OEWSICWM.js} +8 -8
  62. package/dist/{chunk-DEWD22FA.js → chunk-OI4ZV7MJ.js} +1 -1
  63. package/dist/{chunk-IJ4DF5QS.js → chunk-OK4RSIB2.js} +1 -1
  64. package/dist/{chunk-PM4YDVAX.js → chunk-OWEJP5HJ.js} +1 -1
  65. package/dist/{chunk-Z4R73UUH.js → chunk-PA6FKP5B.js} +7 -7
  66. package/dist/{chunk-KFHF3GBH.js → chunk-QFQ2UNZU.js} +6 -6
  67. package/dist/{chunk-D7KYG37D.js → chunk-QGUCHNSQ.js} +82 -16
  68. package/dist/{chunk-OYBBYENC.js → chunk-QNHBJU74.js} +8 -8
  69. package/dist/{chunk-LOG4LBUY.js → chunk-RBLXGO5K.js} +2 -2
  70. package/dist/{chunk-KIYP5TML.js → chunk-SBPMDO47.js} +1 -1
  71. package/dist/{chunk-6JW2L7UV.js → chunk-SKGUS2CB.js} +11 -11
  72. package/dist/{chunk-NHT7RHAI.js → chunk-TD6DN5LU.js} +3 -3
  73. package/dist/{chunk-TFR6S7ZB.js → chunk-TUEEGFAQ.js} +10 -10
  74. package/dist/{chunk-ZWWU7COR.js → chunk-TUSIYONR.js} +1 -1
  75. package/dist/{chunk-UCDCPQXU.js → chunk-TW2V2IQ4.js} +1 -1
  76. package/dist/{chunk-GTKR2YEZ.js → chunk-UCUBQWJC.js} +1 -1
  77. package/dist/{chunk-EI6JYZ42.js → chunk-UUSSRXUJ.js} +3 -3
  78. package/dist/{chunk-OPGF3FUY.js → chunk-VRWZNI6U.js} +2 -2
  79. package/dist/{chunk-B3ILHK4Q.js → chunk-VU5PPWIQ.js} +8 -8
  80. package/dist/{chunk-LA5UO6LI.js → chunk-WH2QUYXH.js} +5 -4
  81. package/dist/{chunk-HW7QPCOP.js → chunk-WVMKXDOW.js} +148 -53
  82. package/dist/{chunk-LLVBDIQJ.js → chunk-XAR2CJFV.js} +7 -7
  83. package/dist/{chunk-BFWZGLUU.js → chunk-XCTE5S2C.js} +1 -1
  84. package/dist/{chunk-NR3FDUWS.js → chunk-XFODM3V7.js} +7 -7
  85. package/dist/{chunk-BDTFO5S7.js → chunk-XFU37HIM.js} +3 -3
  86. package/dist/{chunk-Q6ANHBJK.js → chunk-YO2NPS66.js} +1 -1
  87. package/dist/chunk-YOAJLD2D.js +270 -0
  88. package/dist/{chunk-MMSFADKC.js → chunk-YZQYTOCR.js} +1 -1
  89. package/dist/{claude-launcher-YDSG5XIN.js → claude-launcher-WMIUTAXY.js} +8 -8
  90. package/dist/{cli-7VKJRQWW.js → cli-R5SJT3YL.js} +233 -156
  91. package/dist/{cli-update-notice-AWYJ4A7R.js → cli-update-notice-OC4SOSZE.js} +2 -2
  92. package/dist/{command-3WAJBJWX.js → command-LWMX6I7W.js} +55 -54
  93. package/dist/{config-O2LJAZJZ.js → config-ZRGYLVDX.js} +13 -13
  94. package/dist/{connect-cmd-3DBWVCUL.js → connect-cmd-MZXTWM4R.js} +15 -15
  95. package/dist/{container-start-T4GH4WLX.js → container-start-VQR5ERZE.js} +53 -52
  96. package/dist/{context-cleanup-Z23RX7JT.js → context-cleanup-Z3HZZZXW.js} +5 -5
  97. package/dist/{context-show-cmd-OGRCR5OT.js → context-show-cmd-SCOVPVDM.js} +16 -16
  98. package/dist/{control-plane-launch-JZPULKCL.js → control-plane-launch-MWZHJ4G5.js} +16 -16
  99. package/dist/{demo-record-cmd-YPWPHDAN.js → demo-record-cmd-4RVSWVMK.js} +9 -9
  100. package/dist/{demo-voice-cmd-TNZ2G5CJ.js → demo-voice-cmd-PGM5JPCQ.js} +24 -24
  101. package/dist/{dist-OMJJT636.js → dist-XEPPXF4M.js} +2 -2
  102. package/dist/docker-25F2KOBJ.js +20 -0
  103. package/dist/{doctor-KHAB6YWH.js → doctor-3QJLCHQY.js} +55 -54
  104. package/dist/emit-artifact-cmd-Z4SHPKFT.js +44 -0
  105. package/dist/{emit-cmd-3YOUQCID.js → emit-cmd-NHMZ4M5S.js} +8 -8
  106. package/dist/emit-criteria-cmd-HCN3DOJM.js +35 -0
  107. package/dist/{emit-demo-cmd-3UBPYRAM.js → emit-demo-cmd-NOSQTOES.js} +24 -24
  108. package/dist/emit-finding-cmd-YXR3ZVCJ.js +36 -0
  109. package/dist/{emit-result-cmd-KRUV7V74.js → emit-result-cmd-Z7MBE37R.js} +22 -22
  110. package/dist/emit-step-cmd-JOSYDSEO.js +35 -0
  111. package/dist/{exec-client-WJLO2KWS.js → exec-client-SZRXXKJ5.js} +9 -9
  112. package/dist/find-unit-3RHC4375.js +24 -0
  113. package/dist/{findings-cmd-3JP4GYD3.js → findings-cmd-NGFY25WZ.js} +20 -20
  114. package/dist/{fleet-readiness-U4IZZV52.js → fleet-readiness-NWIVQQ4P.js} +16 -16
  115. package/dist/governing-source-DNWVPRXP.js +41 -0
  116. package/dist/guest-init-T7QJW2AJ.js +20 -0
  117. package/dist/{hook-fast-2ENS5AKU.js → hook-fast-ECQBMESE.js} +3 -3
  118. package/dist/{hook-install-JTYPE5ZQ.js → hook-install-MBMG3G6B.js} +5 -5
  119. package/dist/host-checks-EHSA6FLE.js +80 -0
  120. package/dist/host-key-6SMJUTJ2.js +18 -0
  121. package/dist/{image-tag-EX2R462S.js → image-tag-OCVY4W5D.js} +9 -9
  122. package/dist/index.js +4 -4
  123. package/dist/{init-7F2KP6XU.js → init-ETG7XYFQ.js} +51 -50
  124. package/dist/init-F7NB7GBW.js +80 -0
  125. package/dist/{init-agent-RJSMNEWD.js → init-agent-WEYGBAII.js} +51 -50
  126. package/dist/{init-cmd-F72BWVFC.js → init-cmd-KGM7TN6Z.js} +29 -29
  127. package/dist/{init-update-ZWSICDTJ.js → init-update-EUJ4264S.js} +26 -26
  128. package/dist/install-cmd-HWG6LJX5.js +21 -0
  129. package/dist/{layout-4FLIBRPO.js → layout-CGE4KWGO.js} +5 -5
  130. package/dist/{login-browser-ZEOXKIQ2.js → login-browser-G7WNR74C.js} +2 -2
  131. package/dist/{logs-BWGJ2BVT.js → logs-TKWJ4S4W.js} +8 -8
  132. package/dist/loop-K3QREUHK.js +90 -0
  133. package/dist/machine-5GTYN2LP.js +80 -0
  134. package/dist/{machine-skills-UEQA3AUX.js → machine-skills-CXA57QHE.js} +5 -5
  135. package/dist/{mcp-install-cmd-DBKKGLHW.js → mcp-install-cmd-6IGK65DV.js} +5 -5
  136. package/dist/{mcp-serve-cmd-LFXU5UGJ.js → mcp-serve-cmd-DVE5XP2U.js} +11 -11
  137. package/dist/{paths-CSZZQK3X.js → paths-VOWYUJLZ.js} +8 -8
  138. package/dist/pending-35ML3JE5.js +18 -0
  139. package/dist/{pidfile-TTIUEDXW.js → pidfile-MFP6B2KV.js} +9 -9
  140. package/dist/{record-U7DU6IVT.js → record-AWCJ3LTG.js} +9 -9
  141. package/dist/{relay-KZTGUSFJ.js → relay-YVZM5M6B.js} +6 -6
  142. package/dist/{relay-protocol-LG4J5K63.js → relay-protocol-MNWITORT.js} +6 -6
  143. package/dist/run-cmd-MBH5Z2UL.js +114 -0
  144. package/dist/{runner-agents-32J743FJ.js → runner-agents-L3PLYFWJ.js} +5 -5
  145. package/dist/runner-env-IHWYZ3B6.js +24 -0
  146. package/dist/{runner-identity-VQCIKNBK.js → runner-identity-E2XKIJNB.js} +11 -11
  147. package/dist/{runner-key-TFFPQCGE.js → runner-key-3AHJX75Z.js} +51 -50
  148. package/dist/session-sender-IS6S7PBC.js +44 -0
  149. package/dist/{spec-cmd-RQFIJ75J.js → spec-cmd-ZLDYL4N5.js} +21 -21
  150. package/dist/{starter-pack-LO3D6CPP.js → starter-pack-XINCCMDN.js} +6 -6
  151. package/dist/state-NIA6XT7D.js +18 -0
  152. package/dist/{status-KGZWBU26.js → status-GZ7KAIMH.js} +51 -50
  153. package/dist/{sync-cmd-4RSCWFAF.js → sync-cmd-3YZ4IB3T.js} +22 -22
  154. package/dist/update-steps-XY46I7FV.js +81 -0
  155. package/dist/{watch-NH5QZJLE.js → watch-LIIODJ5U.js} +22 -22
  156. package/dist/{work-claim-cmd-FNE2ZMVG.js → work-claim-cmd-GWBWIZ43.js} +25 -25
  157. package/dist/work-cmd-CJWTGOU5.js +33 -0
  158. package/dist/work-comment-cmd-RFVCNEET.js +39 -0
  159. package/dist/{work-demo-cmd-56C6JQD3.js → work-demo-cmd-Q2GKJCVL.js} +18 -18
  160. package/dist/{work-launch-LWDQXLGI.js → work-launch-ODTGCNJC.js} +1 -1
  161. package/dist/{work-logs-cmd-XKVZ2UY6.js → work-logs-cmd-KZQBPU2J.js} +18 -18
  162. package/dist/{work-needs-attention-cmd-DYD3AIRU.js → work-needs-attention-cmd-L3DOYAMK.js} +18 -18
  163. package/dist/{work-no-change-cmd-QVD67UG5.js → work-no-change-cmd-SHP25CJB.js} +18 -18
  164. package/dist/{work-open-pr-cmd-3SSJPKHW.js → work-open-pr-cmd-VATPLVSL.js} +20 -20
  165. package/dist/work-pr-cmd-XBLNONT3.js +34 -0
  166. package/dist/work-proofs-cmd-T5WZG3CX.js +37 -0
  167. package/dist/{work-proofs-record-KEZ6Z4QH.js → work-proofs-record-6YF4BS3K.js} +28 -28
  168. package/dist/{work-stop-cmd-4KNMURDC.js → work-stop-cmd-BLOSL24H.js} +18 -18
  169. package/package.json +2 -2
  170. package/skill-pack/maintained/outerlayer-amend/SKILL.md +1 -0
  171. package/skill-pack/maintained/outerlayer-amend/references/attachments.md +23 -0
  172. package/skill-pack/maintained/outerlayer-build/SKILL.md +5 -0
  173. package/skill-pack/maintained/outerlayer-cli/SKILL.md +9 -0
  174. package/skill-pack/maintained/outerlayer-run/SKILL.md +49 -0
  175. package/skill-pack/shipped.json +2 -0
  176. package/skill-pack/template/spec/SKILL.md +10 -11
  177. package/skill-pack/template/writing-specs/SKILL.md +18 -22
  178. package/dist/agent-setup-MLSWF7RF.js +0 -40
  179. package/dist/caller-VU7QBFHQ.js +0 -23
  180. package/dist/chunk-UNA4YIHE.js +0 -128
  181. package/dist/docker-MOESJVCB.js +0 -20
  182. package/dist/emit-artifact-cmd-W7YBXLA7.js +0 -44
  183. package/dist/emit-criteria-cmd-KZW275Q2.js +0 -35
  184. package/dist/emit-finding-cmd-NL6H2PBJ.js +0 -36
  185. package/dist/emit-step-cmd-SHBIO2JI.js +0 -35
  186. package/dist/find-unit-YNIILXQK.js +0 -24
  187. package/dist/governing-source-VZFU65KP.js +0 -41
  188. package/dist/guest-init-HIKD3MHJ.js +0 -20
  189. package/dist/host-checks-HZLHQ6WH.js +0 -79
  190. package/dist/host-key-V2VVCBGR.js +0 -18
  191. package/dist/init-XTTWPX6J.js +0 -79
  192. package/dist/install-cmd-LX76Y7NB.js +0 -21
  193. package/dist/loop-O5JBFZXP.js +0 -90
  194. package/dist/machine-LGJSYGQS.js +0 -79
  195. package/dist/pending-BHRSEFXV.js +0 -18
  196. package/dist/runner-env-RGYTHURZ.js +0 -24
  197. package/dist/session-sender-3VFTMIM3.js +0 -44
  198. package/dist/state-IH6JOEJZ.js +0 -18
  199. package/dist/update-steps-3LU3NZQL.js +0 -80
  200. package/dist/work-cmd-32J5UQJO.js +0 -33
  201. package/dist/work-comment-cmd-ZUZEAIIH.js +0 -38
  202. package/dist/work-pr-cmd-DF6Q5XHU.js +0 -34
  203. package/dist/work-proofs-cmd-2XWS5N2R.js +0 -37
@@ -1,34 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
4
- import { reportFailedStart, fitImageBuildMemory } from './chunk-NR3FDUWS.js';
4
+ import { reportFailedStart, fitImageBuildMemory } from './chunk-XFODM3V7.js';
5
5
  import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
6
- import { writeFleetState } from './chunk-DX27B42J.js';
7
- import { writePendingUpdate } from './chunk-4EQQS3VJ.js';
8
- import { renderUpdateSteps } from './chunk-O4Q7GPKU.js';
9
- import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-MMSFADKC.js';
10
- import { RUNNER_PROTOCOL } from './chunk-5TZCV6JB.js';
11
- import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, askFleetMachine } from './chunk-TFR6S7ZB.js';
12
- import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-X45WDWSV.js';
13
- import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, releaseLease, LEASE_SECONDS, itemTag, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, unfinishedJobs, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, listItemDisks, usableCpus, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, restartSender, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, vmAlive, writeGuestGhConfig, shellQuote, deliverJobFiles, inTeardown } from './chunk-HW7QPCOP.js';
14
- import { RUNNER_RESERVE_BYTES } from './chunk-4K2EMRJP.js';
15
- import { RepoFilter } from './chunk-4LUHKCDO.js';
6
+ import { writeFleetState } from './chunk-EHPKACA7.js';
7
+ import { writePendingUpdate } from './chunk-HDEYRLWK.js';
8
+ import { renderUpdateSteps } from './chunk-3W5JLANR.js';
9
+ import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-YZQYTOCR.js';
10
+ import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, askFleetMachine } from './chunk-TUEEGFAQ.js';
11
+ import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-5QFFQCSY.js';
12
+ import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, itemTag, releaseLease, runIsolation, runCommandOf, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, unfinishedJobs, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, listItemDisks, usableCpus, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, deliverJobFiles, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, inTeardown } from './chunk-WVMKXDOW.js';
13
+ import { RUNNER_PROTOCOL } from './chunk-6XMC6R4W.js';
14
+ import { RUNNER_RESERVE_BYTES } from './chunk-DKDBMMX7.js';
15
+ import { RepoFilter } from './chunk-CXXQQST7.js';
16
16
  import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
17
- import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-6EN72I2O.js';
17
+ import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-2WNJ2MHD.js';
18
18
  import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
19
- import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls } from './chunk-X56UUEHE.js';
20
- import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-DEWD22FA.js';
19
+ import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls, configForJob } from './chunk-MSARYPFD.js';
20
+ import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-OI4ZV7MJ.js';
21
21
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
22
- import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-CCEP5WBI.js';
23
- import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-7TM2E4RI.js';
24
- import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-KX4JKW4Z.js';
25
- import { allocatedBytes, freeBytes, formatBytes } from './chunk-LOG4LBUY.js';
26
- import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun } from './chunk-2J3X2Z4F.js';
27
- import { loadHostKey, ensureHostKey, signerFor } from './chunk-RVYMYTXX.js';
28
- import { RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, jobsDir, pidFilePath, storeScopes, imagesDir } from './chunk-LO3PSFNT.js';
29
- import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT } from './chunk-QP6SPQU5.js';
30
- import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-LA5UO6LI.js';
31
- import { jobAgent, jobCommandEnv, runnerAgents } from './chunk-GTKR2YEZ.js';
22
+ import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-IVB6A3I7.js';
23
+ import { isSignatureRefusal, WorkCommandError, getJson, postJson, getBytes } from './chunk-B4U5XI4F.js';
24
+ import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-5QDHJT73.js';
25
+ import { allocatedBytes, freeBytes, formatBytes } from './chunk-RBLXGO5K.js';
26
+ import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun } from './chunk-I2N427GS.js';
27
+ import { loadHostKey, ensureHostKey, signerFor } from './chunk-ENHD5PNW.js';
28
+ import { RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, jobsDir, pidFilePath, storeScopes, imagesDir } from './chunk-AC6DM3S3.js';
29
+ import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT } from './chunk-NE7EG3SN.js';
30
+ import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-WH2QUYXH.js';
31
+ import { cleanAttachmentName } from './chunk-QGUCHNSQ.js';
32
+ import { jobAgent, jobCommandEnv, runnerAgents } from './chunk-UCUBQWJC.js';
32
33
  import { resolveVersion } from './chunk-RA3O54FC.js';
33
34
  import { mkdirSync, existsSync, writeFileSync, chmodSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync } from 'fs';
34
35
  import { join, dirname } from 'path';
@@ -395,6 +396,18 @@ function stopsOf(data) {
395
396
  }
396
397
  return stops;
397
398
  }
399
+ function attachmentsOf(raw) {
400
+ if (!Array.isArray(raw)) return [];
401
+ const out = [];
402
+ for (const entry of raw) {
403
+ const a = entry;
404
+ if (a === null || typeof a !== "object") continue;
405
+ const { id, filename, mediaType, sizeBytes } = a;
406
+ if (typeof id !== "string" || id === "" || typeof filename !== "string" || typeof mediaType !== "string" || typeof sizeBytes !== "number") continue;
407
+ out.push({ id, filename, mediaType, sizeBytes });
408
+ }
409
+ return out;
410
+ }
398
411
  function commentsOf(data) {
399
412
  const raw = data?.comments;
400
413
  if (!Array.isArray(raw)) return [];
@@ -405,7 +418,8 @@ function commentsOf(data) {
405
418
  const { claimId, workItemId, commentId, thread, authorName, text, summary, at } = comment;
406
419
  if (typeof claimId !== "string" || typeof workItemId !== "string" || typeof commentId !== "string" || commentId === "") continue;
407
420
  if (typeof thread !== "string" || typeof authorName !== "string" || typeof text !== "string" || typeof at !== "string") continue;
408
- comments.push({ claimId, workItemId, commentId, thread, authorName, text, summary: typeof summary === "string" ? summary : null, at });
421
+ const attachments = attachmentsOf(comment.attachments);
422
+ comments.push({ claimId, workItemId, commentId, thread, authorName, text, summary: typeof summary === "string" ? summary : null, at, ...attachments.length === 0 ? {} : { attachments } });
409
423
  }
410
424
  return comments;
411
425
  }
@@ -481,6 +495,18 @@ async function sendHeartbeat(args, fetchImpl) {
481
495
  return { ok: false, reason: describeCallFailure(err) };
482
496
  }
483
497
  }
498
+ async function deliverInboxAttachments(runtime, state, files, secrets) {
499
+ try {
500
+ for (const file of files) {
501
+ const target = join(state.buildDir, INBOX_FOLDER, file.path);
502
+ mkdirSync(dirname(target), { recursive: true, mode: 493 });
503
+ writeFileSync(target, file.bytes, { mode: 420 });
504
+ }
505
+ } catch (err) {
506
+ return { ok: false, reason: `the attachments for the agent could not be written on the host: ${err instanceof Error ? err.message : String(err)}` };
507
+ }
508
+ return deliverJobFiles(runtime, state, ["inbox"], secrets);
509
+ }
484
510
  async function deliverInboxFile(runtime, state, file, secrets) {
485
511
  const folder = join(state.buildDir, INBOX_FOLDER);
486
512
  try {
@@ -494,6 +520,24 @@ async function deliverInboxFile(runtime, state, file, secrets) {
494
520
 
495
521
  // src/runner/microvm/inbox.ts
496
522
  var ROOT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
523
+ async function writeGuestInboxAttachment(runtime, state, relativePath, bytes) {
524
+ const target = `${JOB_MOUNT}/${INBOX_FOLDER}/${relativePath}`;
525
+ const folder = target.slice(0, target.lastIndexOf("/"));
526
+ const partial = `${folder}/.${target.slice(folder.length + 1)}.partial`;
527
+ const script2 = [
528
+ "set -e",
529
+ "umask 022",
530
+ `mkdir -p ${shellQuote(folder)}`,
531
+ `base64 -d > ${shellQuote(partial)}`,
532
+ `chmod 0644 ${shellQuote(partial)}`,
533
+ `mv ${shellQuote(partial)} ${shellQuote(target)}`
534
+ ].join("\n");
535
+ const result = await runtime.vm.exec(state.vsockPath, { argv: ["/bin/sh", "-c", script2], user: "root", cwd: "/", env: { PATH: ROOT_PATH } }, { stdin: Buffer.from(bytes).toString("base64") });
536
+ if (result.status !== 0) {
537
+ const line = result.stderr.trim().split("\n")[0] ?? "";
538
+ throw new Error(`writing an attachment into the guest's inbox failed (exit ${result.status})${line === "" ? "" : `: ${line}`}`);
539
+ }
540
+ }
497
541
  async function writeGuestInboxFile(runtime, state, file) {
498
542
  const folder = `${JOB_MOUNT}/${INBOX_FOLDER}`;
499
543
  const partial = shellQuote(`${folder}/.${file.id}.partial`);
@@ -525,22 +569,84 @@ function inboxFileOf(comment, job) {
525
569
  authorName: comment.authorName,
526
570
  text: comment.text,
527
571
  summary: comment.summary,
528
- at: comment.at
572
+ at: comment.at,
573
+ ...comment.attachments === void 0 || comment.attachments.length === 0 ? {} : {
574
+ attachments: comment.attachments.map((attachment, position) => {
575
+ const filename = cleanAttachmentName(attachment.filename);
576
+ return {
577
+ id: attachment.id,
578
+ path: `attachments/${comment.commentId}/${position}-${filename}`,
579
+ filename,
580
+ mediaType: attachment.mediaType,
581
+ sizeBytes: attachment.sizeBytes,
582
+ missing: false
583
+ };
584
+ })
585
+ }
529
586
  };
530
587
  }
531
- async function deliverComment(runtime, job, file, secrets) {
588
+ async function deliverComment(runtime, job, file, secrets, fetchAttachment) {
532
589
  if (job.microvm !== void 0) {
533
- if (!vmAlive(runtime, job.microvm)) return { ok: false, reason: "the build's microVM is not running" };
590
+ const state = job.microvm;
591
+ if (!vmAlive(runtime, state)) return { ok: false, reason: "the build's microVM is not running" };
534
592
  try {
535
- await writeGuestInboxFile(runtime, job.microvm, file);
593
+ const placed = await placeAttachments(file, fetchAttachment, (attachment, bytes) => writeGuestInboxAttachment(runtime, state, attachment.path, bytes));
594
+ await writeGuestInboxFile(runtime, state, placed);
536
595
  return { ok: true };
537
596
  } catch (err) {
538
597
  return { ok: false, reason: err instanceof Error ? err.message : String(err) };
539
598
  }
540
599
  }
541
- if (job.container !== void 0 && filesAreCopied(job.container)) return deliverInboxFile(runtime, job.container, file, secrets);
600
+ if (job.container !== void 0 && filesAreCopied(job.container)) {
601
+ const pending = [];
602
+ const placed = await placeAttachments(file, fetchAttachment, async (attachment, bytes) => {
603
+ pending.push({ path: attachment.path, bytes });
604
+ });
605
+ if (pending.length > 0) {
606
+ const copied = await deliverInboxAttachments(runtime, job.container, pending, secrets);
607
+ if (!copied.ok) return copied;
608
+ }
609
+ return deliverInboxFile(runtime, job.container, placed, secrets);
610
+ }
542
611
  return { ok: true, skipped: true };
543
612
  }
613
+ async function placeAttachments(file, fetchAttachment, write) {
614
+ if (file.attachments === void 0) return file;
615
+ const attachments = [];
616
+ for (const attachment of file.attachments) {
617
+ const bytes = fetchAttachment === void 0 ? void 0 : await fetchAttachment(attachment).catch(() => void 0);
618
+ if (bytes === void 0) {
619
+ attachments.push({ ...attachment, missing: true });
620
+ continue;
621
+ }
622
+ try {
623
+ await write(attachment, bytes);
624
+ } catch {
625
+ attachments.push({ ...attachment, missing: true });
626
+ continue;
627
+ }
628
+ attachments.push({ ...attachment, missing: false });
629
+ }
630
+ return { ...file, attachments };
631
+ }
632
+
633
+ // src/runner/attachments.ts
634
+ var ATTACHMENT_DOWNLOAD_TRIES = 3;
635
+ var RETRY_DELAY_MS = 500;
636
+ var DOWNLOAD_TIMEOUT_MS = 6e4;
637
+ async function downloadAttachment(calls, attachment, fetchImpl, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
638
+ const path = `/v1/work-items/${encodeURIComponent(String(calls.item))}/attachments/${encodeURIComponent(attachment.id)}`;
639
+ for (let attempt = 1; attempt <= ATTACHMENT_DOWNLOAD_TRIES; attempt++) {
640
+ try {
641
+ const signer = await signerFor(calls.configPath);
642
+ const got = await getBytes(calls.url, path, calls.apiKey, calls.appId, fetchImpl, signer, { timeoutMs: DOWNLOAD_TIMEOUT_MS });
643
+ return got.bytes;
644
+ } catch {
645
+ if (attempt < ATTACHMENT_DOWNLOAD_TRIES) await sleep(RETRY_DELAY_MS);
646
+ }
647
+ }
648
+ return void 0;
649
+ }
544
650
 
545
651
  // src/runner/host-state.ts
546
652
  function hostState(flags) {
@@ -1491,7 +1597,19 @@ function applyComments(state, comments) {
1491
1597
  delivering.add(comment.commentId);
1492
1598
  const key = `comment ${comment.commentId} for the agent`;
1493
1599
  const runtime = runtimeOf(state);
1494
- void deliverComment(runtime, active.job, file, () => runtime.credentials.get(active.dirPath)?.issuedTokens() ?? []).then((result) => {
1600
+ const fetchAttachment = (attachment) => {
1601
+ try {
1602
+ const calls = claimCalls(state.config, active.job);
1603
+ return downloadAttachment(
1604
+ { url: calls.url, apiKey: calls.apiKey, appId: calls.appId, configPath: calls.configPath, item: claimItem(state.config, active.job) },
1605
+ attachment,
1606
+ state.deps.fetchImpl
1607
+ );
1608
+ } catch {
1609
+ return Promise.resolve(void 0);
1610
+ }
1611
+ };
1612
+ void deliverComment(runtime, active.job, file, () => runtime.credentials.get(active.dirPath)?.issuedTokens() ?? [], fetchAttachment).then((result) => {
1495
1613
  if (result.ok) delivered.add(comment.commentId);
1496
1614
  reportRepeating(state, key, result.ok ? void 0 : `${itemTag(active.job)} the ${key} could not be written into the build: ${result.reason}`);
1497
1615
  }).catch((err) => reportRepeating(state, key, `${itemTag(active.job)} the ${key} could not be written into the build: ${describeCallFailure(err)}`)).finally(() => delivering.delete(comment.commentId));
@@ -2310,6 +2428,11 @@ async function runTick(state) {
2310
2428
  } while (!claimed && cursor !== null);
2311
2429
  if (claimed) break;
2312
2430
  }
2431
+ if (!claimed) {
2432
+ const run = await tryClaimAndStartRun(state);
2433
+ if (run === "stop") return;
2434
+ claimed = run === "started";
2435
+ }
2313
2436
  if (!claimed) break;
2314
2437
  }
2315
2438
  reportRepeating(
@@ -2319,11 +2442,80 @@ async function runTick(state) {
2319
2442
  "line"
2320
2443
  );
2321
2444
  }
2445
+ async function tryClaimAndStartRun(state) {
2446
+ const isolation = runIsolation(state.config);
2447
+ if (isolation === void 0) return "none";
2448
+ if (runCommandOf(state.config, state.deps.agents) === void 0) {
2449
+ reportRepeating(
2450
+ state,
2451
+ "the run command",
2452
+ "takes no run of a schedule automation: the agent that runner.commands.implement starts has no command for a run \xB7 set runner.commands.run in the config file"
2453
+ );
2454
+ return "none";
2455
+ }
2456
+ reportRepeating(state, "the run command", void 0);
2457
+ const log = logOf(state);
2458
+ const hostKey = await loadHostKey(state.config.configPath);
2459
+ const cliVersion = state.deps.cliVersion ?? resolveVersion();
2460
+ const claim = await retrySend(() => claimRun({ config: state.config, isolation, cliVersion, ...hostKey === void 0 ? {} : { hostKey: hostKey.hostKey, signer: hostKey.signer }, fetchImpl: state.deps.fetchImpl }), {
2461
+ now: state.deps.now,
2462
+ sleep: state.deps.sleep
2463
+ });
2464
+ if (!claim.ok) {
2465
+ if (isSignatureRefusal(claim.code)) {
2466
+ reportRepeating(state, "the request signature", claim.message ?? claim.reason);
2467
+ return "stop";
2468
+ }
2469
+ const why = claim.status === 404 ? "the gateway has no run routes yet, so the runs of schedule automations wait until it is upgraded" : claim.message ?? claim.reason;
2470
+ reportRepeating(state, "the run claim", `could not claim a run: ${why}`);
2471
+ return "stop";
2472
+ }
2473
+ reportRepeating(state, "the run claim", void 0);
2474
+ reportRepeating(state, "the request signature", void 0);
2475
+ const answer = claim.value;
2476
+ if (answer.kind === "none") return "none";
2477
+ if (answer.kind === "malformed") {
2478
+ reportRepeating(state, "the run claim", answer.reason);
2479
+ return "stop";
2480
+ }
2481
+ const { run, runKey } = answer;
2482
+ if (claimIsAlreadyRunning(state, run.id)) {
2483
+ log.line(`#${run.id} skipped: the run is already running here`);
2484
+ return "none";
2485
+ }
2486
+ const branch = `outerlayer/run-${run.id.slice(0, 8)}`;
2487
+ const item = { id: run.id, number: run.id, trackerKey: run.id, specRepository: run.repository };
2488
+ const tag = itemTag({ item: run.id, claimId: run.id });
2489
+ try {
2490
+ await startJob(
2491
+ state,
2492
+ item,
2493
+ "run",
2494
+ run.id,
2495
+ runKey,
2496
+ branch,
2497
+ void 0,
2498
+ [{ repository: run.repository.toLowerCase(), branch, primary: true }],
2499
+ void 0,
2500
+ void 0,
2501
+ void 0,
2502
+ void 0,
2503
+ { instructions: run.instructions, issuesLeft: run.issuesLeft, timeLimitSeconds: run.timeLimitSeconds }
2504
+ );
2505
+ } catch (err) {
2506
+ const stranded = [...state.jobs.values()].find((active) => active.job.claimId === run.id);
2507
+ if (stranded === void 0) throw err;
2508
+ const reason = `provision failed: ${describeCallFailure(err)}`;
2509
+ log.error(`${tag} ${reason} \xB7 ending job as failed`);
2510
+ await endJob(state, stranded, "failed", { stage: "provision", reason });
2511
+ }
2512
+ return "started";
2513
+ }
2322
2514
  var CLAIM_REFUSAL_CODES = new Set(
2323
2515
  "pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
2324
2516
  );
2325
2517
  async function tryClaimAndStart(state, item, queue) {
2326
- const { postJson: postJson2 } = await import('./work-cmd-32J5UQJO.js');
2518
+ const { postJson: postJson2 } = await import('./work-cmd-CJWTGOU5.js');
2327
2519
  const log = logOf(state);
2328
2520
  const hostKey = await loadHostKey(state.config.configPath);
2329
2521
  const claim = await retrySend(
@@ -2519,7 +2711,7 @@ async function prepareSession(state, active, item, queue, tag) {
2519
2711
  return void 0;
2520
2712
  }
2521
2713
  }
2522
- async function startJob(state, item, queue, claimId, itemKey, branch, identity, claimed, fleet, freshDisk, diskHeldElsewhere, codeReview) {
2714
+ async function startJob(state, item, queue, claimId, itemKey, branch, identity, claimed, fleet, freshDisk, diskHeldElsewhere, codeReview, run) {
2523
2715
  const log = logOf(state);
2524
2716
  const startedAt = nowOf(state);
2525
2717
  const repositories = repositoriesOf({ repositories: claimed, repository: item.specRepository, branch });
@@ -2528,7 +2720,8 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2528
2720
  mkdirSync(dirPath, { recursive: true, mode: RUNNER_DIR_MODE });
2529
2721
  const runnerRoot = runnerDir(state.config.configPath);
2530
2722
  const jobFilePath = join(dirPath, "job.json");
2531
- const jobAgentId = jobAgent({ command: state.config.commands[queue] }, state.deps.agents)?.descriptor.id;
2723
+ const configuredCommand = queue === "run" ? runCommandOf(state.config, state.deps.agents) : state.config.commands[queue];
2724
+ const jobAgentId = jobAgent({ command: queue === "run" ? state.config.commands.implement : configuredCommand }, state.deps.agents)?.descriptor.id;
2532
2725
  let job = {
2533
2726
  stateFormat: state.deps.jobStateFormat ?? JOB_STATE_FORMAT,
2534
2727
  item: item.number,
@@ -2537,8 +2730,9 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2537
2730
  itemKey,
2538
2731
  branch,
2539
2732
  commitIdentity: identity,
2540
- // The work item the kept session belongs to. A fleet claim names it too, from the same listing.
2541
- workItemId: item.id,
2733
+ // The work item the kept session belongs to. A fleet claim names it too, from the same listing. A run has none.
2734
+ ...queue === "run" ? {} : { workItemId: item.id },
2735
+ ...run === void 0 ? {} : { run },
2542
2736
  ...freshDisk ? { freshDisk: true } : {},
2543
2737
  ...diskHeldElsewhere ? { diskHeldElsewhere: true } : {},
2544
2738
  ...codeReview === true ? { codeReview: true } : {},
@@ -2611,7 +2805,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2611
2805
  active.job.managedVariables = [...settings.settings.variables, ...settings.settings.proxied ?? []].map(({ name }) => name);
2612
2806
  }
2613
2807
  }
2614
- if (state.config.hooks.report) {
2808
+ if (state.config.hooks.report && queue !== "run") {
2615
2809
  setStage(job, dirPath, "report");
2616
2810
  log.line(`${tag} report started \xB7 phase start`);
2617
2811
  const reportStartedMs = nowOf(state).getTime();
@@ -2649,7 +2843,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2649
2843
  ...active.job.organizationId === void 0 ? {} : { organizationId: active.job.organizationId, claimId: active.job.claimId },
2650
2844
  runtime: runtimeOf(state),
2651
2845
  queue,
2652
- workItemId: item.id,
2846
+ ...queue === "run" ? {} : { workItemId: item.id },
2653
2847
  ...freshDisk ? { fresh: true } : {},
2654
2848
  ...diskHeldElsewhere ? { diskHeldElsewhere: true } : {},
2655
2849
  item,
@@ -2696,7 +2890,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2696
2890
  ...active.job.organizationId === void 0 ? {} : { organizationId: active.job.organizationId, claimId: active.job.claimId },
2697
2891
  runtime: runtimeOf(state),
2698
2892
  queue,
2699
- workItemId: item.id,
2893
+ ...queue === "run" ? {} : { workItemId: item.id },
2700
2894
  item,
2701
2895
  itemKey,
2702
2896
  tokens,
@@ -2739,7 +2933,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2739
2933
  ...active.job.organizationId === void 0 ? {} : { organizationId: active.job.organizationId, claimId: active.job.claimId },
2740
2934
  runtime: runtimeOf(state),
2741
2935
  queue,
2742
- workItemId: item.id,
2936
+ ...queue === "run" ? {} : { workItemId: item.id },
2743
2937
  ...freshDisk ? { fresh: true } : {},
2744
2938
  ...diskHeldElsewhere ? { diskHeldElsewhere: true } : {},
2745
2939
  item,
@@ -2785,6 +2979,11 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2785
2979
  }
2786
2980
  }
2787
2981
  } else {
2982
+ if (queue === "run") {
2983
+ log.error(`${tag} the runner's hooks no longer name a container, microVM or sandbox build, and a run takes none other \xB7 ending job as failed`);
2984
+ await endJob(state, active, "failed", { stage: "provision", reason: "a run goes only to a build in a container or a microVM" });
2985
+ return;
2986
+ }
2788
2987
  const runtime = runtimeOf(state);
2789
2988
  const build = await startHostBuild(state, active, primary?.repository);
2790
2989
  const provisionEnv = provisionEnvironment(jobEnv(claimCalls(state.config, active.job), item.number, itemKey, dirPath, process.env, branch, identity?.author, spoolHomeFor(state.config, active.job)), {
@@ -2950,7 +3149,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2950
3149
  await endJob(state, active, "ok", { stage: "command" });
2951
3150
  return;
2952
3151
  }
2953
- const configured = state.config.commands[queue];
3152
+ const configured = queue === "run" ? runCommandOf(state.config, state.deps.agents) : state.config.commands[queue];
2954
3153
  const cmdline = configured === void 0 ? void 0 : currentSkillCommand(configured);
2955
3154
  if (cmdline !== configured) log.line(`${tag} ${formerSkillProblem([queue])}`);
2956
3155
  if (!cmdline) {
@@ -2958,7 +3157,11 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
2958
3157
  await endJob(state, active, "failed", { stage: "command" });
2959
3158
  return;
2960
3159
  }
2961
- const commandEnv = jobCommandEnv(await prepareSession(state, active, item, queue, tag), state.deps.agents, active.job);
3160
+ const commandEnv = {
3161
+ ...jobCommandEnv(await prepareSession(state, active, item, queue, tag), state.deps.agents, active.job),
3162
+ // What the run looks for is for the agent's command alone, like its session id: no other process of the build reads it.
3163
+ ...run === void 0 ? {} : { OUTERLAYER_RUN_INSTRUCTIONS: run.instructions }
3164
+ };
2962
3165
  job = active.job;
2963
3166
  let running;
2964
3167
  try {
@@ -3050,6 +3253,7 @@ function buildTokensFor(state, active) {
3050
3253
  return new BuildTokens({
3051
3254
  config: claimCalls(state.config, active.job),
3052
3255
  item: claimItem(state.config, active.job),
3256
+ ...active.job.queue === "run" ? { run: true } : {},
3053
3257
  primary: primaryOf(repositoriesOf({ repositories: active.job.repositories, repository: active.job.repository, branch: active.job.branch }))?.repository,
3054
3258
  fetchImpl: state.deps.fetchImpl,
3055
3259
  now: state.deps.now,
@@ -3172,7 +3376,7 @@ async function renewLeaseIfDue(state, active, nowMs) {
3172
3376
  const log = logOf(state);
3173
3377
  const tag = `${itemTag(active.job)}`;
3174
3378
  if (!needsRenew(active.lastRenewAtMs, nowMs)) return true;
3175
- const renew = await retrySend(() => renewLease(claimCalls(state.config, active.job), claimItem(state.config, active.job), state.deps.fetchImpl), {
3379
+ const renew = await retrySend(() => active.job.queue === "run" ? renewRun(claimCalls(state.config, active.job), String(active.job.item), state.deps.fetchImpl) : renewLease(claimCalls(state.config, active.job), claimItem(state.config, active.job), state.deps.fetchImpl), {
3176
3380
  now: state.deps.now,
3177
3381
  sleep: state.deps.sleep
3178
3382
  });
@@ -3404,8 +3608,9 @@ async function watchTick(state, active, nowMs, logMtimeMs) {
3404
3608
  await endJob(state, active, "failed", { stage: started ? "command" : "provision", reason: unreachable });
3405
3609
  return;
3406
3610
  }
3407
- if (isTimedOut(new Date(active.job.startedAt).getTime(), nowMs, state.config.timeLimitMinutes)) {
3408
- log.line(`${tag} past the ${state.config.timeLimitMinutes}m time limit \xB7 ending job as timed_out`);
3611
+ const limitMinutes = active.job.run === void 0 ? state.config.timeLimitMinutes : active.job.run.timeLimitSeconds / 60;
3612
+ if (isTimedOut(new Date(active.job.startedAt).getTime(), nowMs, limitMinutes)) {
3613
+ log.line(`${tag} past the ${active.job.run === void 0 ? `${state.config.timeLimitMinutes}m` : `${active.job.run.timeLimitSeconds}s`} time limit \xB7 ending job as timed_out`);
3409
3614
  await endJob(state, active, "timed_out");
3410
3615
  return;
3411
3616
  }
@@ -3472,7 +3677,7 @@ async function rejoinContainerBuild(state, adopted) {
3472
3677
  if (cores !== void 0) runtimeOf(state).cpus.hold(container.buildId, cores);
3473
3678
  const tokens = buildTokensFor(state, adopted);
3474
3679
  runtimeOf(state).credentials.set(dirPath, tokens);
3475
- await ensureTunnel(runtimeOf(state), container, dirPath, config, job.itemKey, job.branch, job.repositories, (line) => logOf(state).line(`${itemTag(job)} ${line}`), () => leaseExpiresAtMs(adopted.job));
3680
+ await ensureTunnel(runtimeOf(state), container, dirPath, configForJob(config, job), job.itemKey, job.branch, job.repositories, (line) => logOf(state).line(`${itemTag(job)} ${line}`), () => leaseExpiresAtMs(adopted.job), job.queue === "run");
3476
3681
  try {
3477
3682
  await tokens.token("read");
3478
3683
  keepGhConfigCurrent(
@@ -3575,8 +3780,8 @@ async function rejoinMicroVmBuild(state, adopted) {
3575
3780
  let leaseServed = false;
3576
3781
  try {
3577
3782
  const repositories = repositoriesOf({ repositories: job.repositories, repository: microvm.repository, branch: job.branch });
3578
- const gitRemote = repositories.length === 0 ? void 0 : gitRemoteFor(runtime, { repositories, tokens, buildDir: microvm.buildDir, organizationId: job.organizationId, log: (line) => log.line(`${tag} ${line}`) });
3579
- runtime.tunnels.set(microvm.buildId, await startServicesFor(runtime, config, microvm.buildDir, dirPath, job.itemKey, microvm.builtIns === true, gitRemote, "socket", void 0, inherit));
3783
+ const gitRemote = repositories.length === 0 ? void 0 : gitRemoteFor(runtime, { repositories, tokens, buildDir: microvm.buildDir, organizationId: job.organizationId, log: (line) => log.line(`${tag} ${line}`), ...job.queue === "run" ? { readOnly: true } : {} });
3784
+ runtime.tunnels.set(microvm.buildId, await startServicesFor(runtime, configForJob(config, job), microvm.buildDir, dirPath, job.itemKey, microvm.builtIns === true, gitRemote, "socket", void 0, inherit));
3580
3785
  servicesServed = true;
3581
3786
  } catch (err) {
3582
3787
  log.error(`${tag} the adopted build's services could not be served again: ${describeCallFailure(err)}`);
@@ -3772,7 +3977,7 @@ async function startRunner(configPath, deps, startup) {
3772
3977
  check: update.check ? () => update.check(configPath) : async () => {
3773
3978
  const held = runnerAgents(deps.agents).flatMap((agent) => heldAgentCredential(agent.descriptor.id) ?? []);
3774
3979
  const env = { ...process.env, ...Object.fromEntries(held.map((credential) => [credential.variable, credential.value])) };
3775
- return (await import('./check-YUKNUSAS.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3980
+ return (await import('./check-SJCTNS7N.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3776
3981
  },
3777
3982
  now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
3778
3983
  log
@@ -4156,4 +4361,4 @@ function runnerProcessState(configPath) {
4156
4361
  return isSameProcess(entry.pid, entry.start) ? { state: "running", pid: entry.pid } : { state: "stale", pid: entry.pid };
4157
4362
  }
4158
4363
 
4159
- export { LAPSED_REASON, RunnerStartError, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, prepareSession, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
4364
+ export { LAPSED_REASON, RunnerStartError, applyComments, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, prepareSession, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-LOG4LBUY.js';
4
- import { parseSize } from './chunk-2J3X2Z4F.js';
5
- import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-QP6SPQU5.js';
6
- import { builderDiskPinned } from './chunk-GTKR2YEZ.js';
3
+ import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-RBLXGO5K.js';
4
+ import { parseSize } from './chunk-I2N427GS.js';
5
+ import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-NE7EG3SN.js';
6
+ import { builderDiskPinned } from './chunk-UCUBQWJC.js';
7
7
  import { homeFromEnv } from './chunk-352DHUTP.js';
8
8
  import { existsSync, statSync, accessSync, constants, readFileSync } from 'fs';
9
9
  import { hostname } from 'os';
@@ -414,6 +414,9 @@ function loadRunnerConfig(configPath) {
414
414
  fail(configPath, `runner.commands.${queue}`, "is required for an enabled queue");
415
415
  }
416
416
  }
417
+ if (runner.commands?.run !== void 0 && (typeof runner.commands.run !== "string" || runner.commands.run.trim() === "")) {
418
+ fail(configPath, "runner.commands.run", "must be a command line, or left out");
419
+ }
417
420
  if (fleet) {
418
421
  for (const queue of RUNNER_QUEUES) {
419
422
  if (!runner.commands?.[queue]) {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-LO3PSFNT.js';
3
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AC6DM3S3.js';
4
4
  import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
5
5
  import { join, basename, sep, resolve } from 'path';
6
6
 
@@ -2,10 +2,10 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-2AM6Z5BP.js';
4
4
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
5
- import { linkedAgentsPath } from './chunk-TNAUQADA.js';
6
- import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-OKELGJNN.js';
5
+ import { linkedAgentsPath } from './chunk-ITOIM3WV.js';
6
+ import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-MT4XF5OL.js';
7
7
  import { LEGACY_AGENT } from './chunk-7PZDPISM.js';
8
- import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
8
+ import { MAINTAINED_SKILLS } from './chunk-ATEMEVFF.js';
9
9
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
10
10
  import { readFileSync, existsSync, mkdirSync, writeFileSync } from 'fs';
11
11
  import { join, dirname } from 'path';
@@ -4,6 +4,6 @@ import { createRequire } from 'node:module';
4
4
  createRequire(import.meta.url);
5
5
 
6
6
  // src/runner/protocol.ts
7
- var RUNNER_PROTOCOL = 47;
7
+ var RUNNER_PROTOCOL = 49;
8
8
 
9
9
  export { RUNNER_PROTOCOL };
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launchRefusalForSession } from './chunk-WGC7UFRM.js';
4
- import { detectActiveSession } from './chunk-KIYP5TML.js';
5
- import { autoConnect } from './chunk-BDTFO5S7.js';
6
- import { acquireSpoolLockAt } from './chunk-2DVQHK37.js';
3
+ import { launchRefusalForSession } from './chunk-C2PZOLN7.js';
4
+ import { detectActiveSession } from './chunk-SBPMDO47.js';
5
+ import { autoConnect } from './chunk-XFU37HIM.js';
6
+ import { acquireSpoolLockAt } from './chunk-B5Z4VA4Q.js';
7
7
  import { C } from './chunk-2AM6Z5BP.js';
8
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-OPGF3FUY.js';
9
- import { launchedItemForSession } from './chunk-4OD45RBP.js';
8
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-VRWZNI6U.js';
9
+ import { launchedItemForSession } from './chunk-LGJ56FCM.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
11
  import { homeFromEnv } from './chunk-352DHUTP.js';
12
- import { resolveRepoIdentity } from './chunk-N2QYP3NQ.js';
13
- import { StepNameSchema, StepBodySchema } from './chunk-HE53NIRE.js';
12
+ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
13
+ import { StepNameSchema, StepBodySchema } from './chunk-FXVHF6RX.js';
14
14
  import { randomUUID } from 'crypto';
15
15
  import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, appendFileSync } from 'fs';
16
16
  import { join, dirname } from 'path';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { PROXY_WARNING_FLAG } from './chunk-QP6SPQU5.js';
4
- import { RELAY_ID, RELAY_USER } from './chunk-LA5UO6LI.js';
5
- import { imageInstalls, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-GTKR2YEZ.js';
6
- import { defaultAgents } from './chunk-OKELGJNN.js';
3
+ import { PROXY_WARNING_FLAG } from './chunk-NE7EG3SN.js';
4
+ import { RELAY_ID, RELAY_USER } from './chunk-WH2QUYXH.js';
5
+ import { imageInstalls, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-UCUBQWJC.js';
6
+ import { defaultAgents } from './chunk-MT4XF5OL.js';
7
7
 
8
8
  createRequire(import.meta.url);
9
9
 
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launchRefusalForSession } from './chunk-WGC7UFRM.js';
4
- import { detectActiveSession } from './chunk-KIYP5TML.js';
5
- import { autoConnect } from './chunk-BDTFO5S7.js';
3
+ import { launchRefusalForSession } from './chunk-C2PZOLN7.js';
4
+ import { detectActiveSession } from './chunk-SBPMDO47.js';
5
+ import { autoConnect } from './chunk-XFU37HIM.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
7
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-OPGF3FUY.js';
8
- import { launchedItemForSession } from './chunk-4OD45RBP.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-VRWZNI6U.js';
8
+ import { launchedItemForSession } from './chunk-LGJ56FCM.js';
9
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
10
10
  import { homeFromEnv } from './chunk-352DHUTP.js';
11
- import { resolveRepoIdentity } from './chunk-N2QYP3NQ.js';
12
- import { CriteriaListSchema } from './chunk-HE53NIRE.js';
11
+ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
12
+ import { CriteriaListSchema } from './chunk-FXVHF6RX.js';
13
13
  import { readFileSync } from 'fs';
14
14
 
15
15
  createRequire(import.meta.url);