@outerlayer/cli 0.36.0-next.20261101174803 → 0.36.0-next.20261102135508

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 (206) hide show
  1. package/dist/agent-setup-Q3HDN23U.js +39 -0
  2. package/dist/agent-subcommand-Z6SOLWZW.js +25 -0
  3. package/dist/bridge-4KPODDN7.js +15 -0
  4. package/dist/build-KYXFZQ33.js +23 -0
  5. package/dist/build-disk-W6AL5WHI.js +20 -0
  6. package/dist/build-info.json +1 -1
  7. package/dist/builder-IMNOEYV7.js +19 -0
  8. package/dist/caller-NLRE272L.js +22 -0
  9. package/dist/{check-K4RVAP4L.js → check-WWX32IGY.js} +78 -74
  10. package/dist/{chunk-MKSZHT6S.js → chunk-2YC3TXWX.js} +1 -1
  11. package/dist/{chunk-QIOTIQWD.js → chunk-3UFX6KH2.js} +12 -11
  12. package/dist/{chunk-F2LPX2HS.js → chunk-3YEPLVNW.js} +8 -8
  13. package/dist/chunk-4DLJ343I.js +38 -0
  14. package/dist/{chunk-5WYT3PPE.js → chunk-4OD45RBP.js} +4 -1
  15. package/dist/{chunk-H7SKHAUE.js → chunk-4XXBV37R.js} +6 -6
  16. package/dist/{chunk-XNBUZGRO.js → chunk-6B3V6EGQ.js} +11 -9
  17. package/dist/{chunk-O36YAH2G.js → chunk-6HDXRDC5.js} +4 -4
  18. package/dist/chunk-6JLYU322.js +68 -0
  19. package/dist/{chunk-5GHJFETA.js → chunk-6KH3NMIT.js} +3010 -1196
  20. package/dist/{chunk-SPXVFFQV.js → chunk-AQE6E54X.js} +10 -9
  21. package/dist/{chunk-LGV5N5DG.js → chunk-ATKCHMFD.js} +1 -1
  22. package/dist/{chunk-7J7HRYZ3.js → chunk-B2P72DAE.js} +1 -1
  23. package/dist/{chunk-LEHBDEUG.js → chunk-B36NSEUM.js} +4 -5
  24. package/dist/{chunk-B62TYDP2.js → chunk-B5SWBFVE.js} +5 -4
  25. package/dist/chunk-BSPJI5T7.js +28 -0
  26. package/dist/{chunk-VJYSPH2J.js → chunk-BUYXEU7J.js} +26 -21
  27. package/dist/{chunk-CIUD3436.js → chunk-BZSJ77MO.js} +1 -1
  28. package/dist/{chunk-OEBFKPHK.js → chunk-CDG475ZP.js} +11 -11
  29. package/dist/{chunk-AGKQEOFS.js → chunk-CSBW4LGL.js} +54 -31
  30. package/dist/{chunk-D2OTBS47.js → chunk-CSVJGW3I.js} +2 -2
  31. package/dist/{chunk-GANAOCHR.js → chunk-CXJC3JLN.js} +25 -374
  32. package/dist/{chunk-WAZJPDR2.js → chunk-D4VGJQY7.js} +1 -1
  33. package/dist/{chunk-BRUDBWLO.js → chunk-D5I5SSPU.js} +7 -7
  34. package/dist/{chunk-KFUDKFEH.js → chunk-D6EXW4EB.js} +45 -19
  35. package/dist/{chunk-AF6DQJ5W.js → chunk-DG3M5DZU.js} +1 -1
  36. package/dist/{chunk-WT7J2627.js → chunk-DTCTXDJP.js} +1 -1
  37. package/dist/chunk-DTQPDMHG.js +654 -0
  38. package/dist/{chunk-EZRAR5YG.js → chunk-E3TP4QTM.js} +1 -1
  39. package/dist/{chunk-NFZJ5XHP.js → chunk-ENBOAE2W.js} +33 -32
  40. package/dist/{chunk-R3252UTU.js → chunk-ENMX3VQ7.js} +7 -7
  41. package/dist/{chunk-AH6634HC.js → chunk-FOSYM7TQ.js} +1 -2
  42. package/dist/{chunk-HL7UNTXO.js → chunk-FRMAQ3C4.js} +17 -10
  43. package/dist/{chunk-HAWPG7QW.js → chunk-FTP7SE6Y.js} +3 -3
  44. package/dist/{chunk-IP7BIBXJ.js → chunk-FWSVWPMS.js} +16 -7
  45. package/dist/{chunk-GLUQVET2.js → chunk-GFZ7PELR.js} +6 -6
  46. package/dist/{chunk-UZGQT6OF.js → chunk-H2NJG3TE.js} +6 -3
  47. package/dist/{chunk-46OBCATR.js → chunk-HRHWA6TZ.js} +1 -1
  48. package/dist/chunk-HTRDL42C.js +45 -0
  49. package/dist/{chunk-YBAVN6WS.js → chunk-I4DM7SNX.js} +7 -7
  50. package/dist/{chunk-24FEVLX7.js → chunk-I6U6QPN6.js} +1311 -73
  51. package/dist/{chunk-4DJZSNVT.js → chunk-IKFAJTLZ.js} +1 -1
  52. package/dist/{chunk-55PYF6S2.js → chunk-J2OMKFYB.js} +3 -3
  53. package/dist/{chunk-7Y5VW4JG.js → chunk-K2G3VB7W.js} +1 -1
  54. package/dist/chunk-K7N6LAPC.js +78 -0
  55. package/dist/{chunk-ULBVE7MP.js → chunk-KRCU66AM.js} +9 -9
  56. package/dist/{chunk-JU3VU42K.js → chunk-LHHDX7FB.js} +5 -5
  57. package/dist/{chunk-FUJUFLDC.js → chunk-LO4CK734.js} +8 -14
  58. package/dist/chunk-LSLK4RS4.js +82 -0
  59. package/dist/{chunk-ABAVN4RT.js → chunk-LSZUTI6O.js} +29 -26
  60. package/dist/chunk-MVPOYQQY.js +136 -0
  61. package/dist/{chunk-YQHEJ5SV.js → chunk-NXQK2I3G.js} +3 -3
  62. package/dist/{chunk-DJMR4YPG.js → chunk-O3MJAHLI.js} +82 -96
  63. package/dist/{chunk-B7PYT2BY.js → chunk-PBGNX3PS.js} +6 -3
  64. package/dist/{chunk-CJJDJ7AT.js → chunk-PIZA7OG2.js} +5 -3
  65. package/dist/{chunk-RIHB3HA2.js → chunk-PMA67TIN.js} +3 -3
  66. package/dist/{chunk-DJDTL6AY.js → chunk-QKOJ22OV.js} +148 -293
  67. package/dist/{chunk-RDWKRG4K.js → chunk-RF4JHGGB.js} +7 -7
  68. package/dist/{chunk-MOOZJRKM.js → chunk-SJJXDU2J.js} +27 -30
  69. package/dist/chunk-T5QBWM6M.js +113 -0
  70. package/dist/{chunk-W7I65BKE.js → chunk-TJIFYV2Z.js} +12 -12
  71. package/dist/{chunk-EBOQU6QC.js → chunk-TKY3SDXH.js} +6 -6
  72. package/dist/{chunk-ALEUIS35.js → chunk-ULBYRPAP.js} +1 -1
  73. package/dist/{chunk-ZP7F3OHV.js → chunk-URHS76GV.js} +48 -38
  74. package/dist/{chunk-X2XTCGUS.js → chunk-VAYVTUU4.js} +11 -12
  75. package/dist/{chunk-TSYHUUAT.js → chunk-VUH7KKVD.js} +3 -3
  76. package/dist/{chunk-RIIPBJK6.js → chunk-WACPWYMH.js} +4 -4
  77. package/dist/{chunk-AAGU5FJF.js → chunk-WGC7UFRM.js} +1 -1
  78. package/dist/{chunk-2SRQSGPR.js → chunk-WVAXJOWG.js} +30 -24
  79. package/dist/{chunk-KLXECBIE.js → chunk-XEWG4AB2.js} +151 -108
  80. package/dist/{chunk-KDK6AF7B.js → chunk-XIDDJSQU.js} +7 -6
  81. package/dist/{chunk-MXIFRYLA.js → chunk-Y4E7IS7H.js} +2 -2
  82. package/dist/{chunk-DHFNBNC3.js → chunk-YJQ7YA7J.js} +5 -5
  83. package/dist/{chunk-6A2GEFN3.js → chunk-YMVRCSKD.js} +4 -4
  84. package/dist/{chunk-JW5BENE6.js → chunk-YYQ5NOT5.js} +3 -3
  85. package/dist/chunk-ZHQC43NH.js +130 -0
  86. package/dist/{chunk-KB5B6ZT5.js → chunk-ZSRMJOAK.js} +20 -20
  87. package/dist/{claude-launcher-L77BKZOC.js → claude-launcher-LGKJZH33.js} +99 -120
  88. package/dist/{cli-QQY5UECM.js → cli-Q5L64EEG.js} +327 -298
  89. package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
  90. package/dist/{command-QLHQZ32L.js → command-CGEFJZNC.js} +65 -64
  91. package/dist/{config-5GY7FL35.js → config-T22KVOOT.js} +14 -10
  92. package/dist/connect-cmd-RUBP466E.js +28 -0
  93. package/dist/{container-start-OCJODSMB.js → container-start-JRF3SBUA.js} +65 -62
  94. package/dist/{context-cleanup-A7KBEBIO.js → context-cleanup-3K2AOECJ.js} +6 -2
  95. package/dist/{context-show-cmd-MZ74ZIVO.js → context-show-cmd-4UXO5WQJ.js} +18 -16
  96. package/dist/{control-plane-launch-3TZFOSCX.js → control-plane-launch-AAH4YH56.js} +31 -27
  97. package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-2OKCGST7.js} +10 -5
  98. package/dist/{demo-voice-cmd-4INIOVTC.js → demo-voice-cmd-GEPX7GIG.js} +27 -27
  99. package/dist/{dist-6KGTCWKR.js → dist-VVZIGSAF.js} +1 -1
  100. package/dist/docker-5VWK335X.js +19 -0
  101. package/dist/{doctor-DB2AJUAO.js → doctor-EQM3JRZI.js} +81 -76
  102. package/dist/emit-artifact-cmd-TA3MPHLU.js +43 -0
  103. package/dist/{emit-cmd-IOWTTZSA.js → emit-cmd-RO4L4PFZ.js} +9 -8
  104. package/dist/emit-criteria-cmd-NMTUV2KM.js +34 -0
  105. package/dist/emit-demo-cmd-Y2Y6LEL7.js +46 -0
  106. package/dist/{emit-finding-cmd-KQIGM5IF.js → emit-finding-cmd-VECM64UR.js} +20 -19
  107. package/dist/{emit-result-cmd-6Q7OU2NY.js → emit-result-cmd-2ERWFDUN.js} +25 -24
  108. package/dist/{emit-step-cmd-GZU5O2FR.js → emit-step-cmd-V2ET66N4.js} +20 -19
  109. package/dist/exec-client-54XKNPTI.js +16 -0
  110. package/dist/find-unit-CNAPU7XQ.js +23 -0
  111. package/dist/{findings-cmd-T7PQAVJG.js → findings-cmd-QJPPF6BY.js} +20 -19
  112. package/dist/{fleet-readiness-PTMOEX6L.js → fleet-readiness-DKAPHAZN.js} +16 -15
  113. package/dist/governing-source-7PZ6DAJU.js +40 -0
  114. package/dist/guest-init-5QZRGP62.js +18 -0
  115. package/dist/{hook-fast-RW7RU3O6.js → hook-fast-VXROB4KF.js} +7 -5
  116. package/dist/hook-install-GDNRMML4.js +14 -0
  117. package/dist/{hook-wrap-fast-545QJSBJ.js → hook-wrap-fast-LWWKKPGK.js} +4 -2
  118. package/dist/host-checks-WAPO5X7X.js +78 -0
  119. package/dist/host-key-HLLV37NV.js +16 -0
  120. package/dist/image-tag-PBWQBATH.js +17 -0
  121. package/dist/index.js +8 -9
  122. package/dist/init-EK3PUU6W.js +78 -0
  123. package/dist/{init-HUQLVUPO.js → init-Y2URPVVY.js} +62 -59
  124. package/dist/{init-cmd-6NQGBVAJ.js → init-cmd-XNANUDIW.js} +38 -33
  125. package/dist/{init-update-MA6QKX46.js → init-update-EFCTKF6D.js} +55 -46
  126. package/dist/install-cmd-RHFUZFV4.js +19 -0
  127. package/dist/layout-7XMC7S6K.js +13 -0
  128. package/dist/{logs-FEITSC2V.js → logs-E7MGQINH.js} +10 -3
  129. package/dist/loop-L6TX6OR4.js +89 -0
  130. package/dist/machine-VJKAY2GX.js +78 -0
  131. package/dist/{machine-skills-237PQFRC.js → machine-skills-HR4RNRNR.js} +5 -4
  132. package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-SMPLT43Q.js} +7 -1
  133. package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-XXERT673.js} +11 -7
  134. package/dist/{paths-XEYE7OZ2.js → paths-F2ZR2EKC.js} +10 -3
  135. package/dist/pending-VOFQRXP4.js +16 -0
  136. package/dist/pidfile-7M7O2M7T.js +17 -0
  137. package/dist/record-YCJ6DZOY.js +16 -0
  138. package/dist/{relay-IEYNSKAZ.js → relay-I2T43PPB.js} +8 -1
  139. package/dist/relay-protocol-GI2GC2AM.js +13 -0
  140. package/dist/runner-env-YW55JVU7.js +23 -0
  141. package/dist/runner-identity-Y5ZFCC7V.js +19 -0
  142. package/dist/{runner-key-CFZ47PR3.js → runner-key-R47C6374.js} +54 -54
  143. package/dist/session-sender-UPACLRGG.js +43 -0
  144. package/dist/{shell-function-NRD4KVUK.js → shell-function-GYD2ZQQG.js} +2 -1
  145. package/dist/{spec-cmd-CNASSB6L.js → spec-cmd-7QRE2SZK.js} +21 -20
  146. package/dist/{starter-pack-CCVIEY72.js → starter-pack-IMKIUA56.js} +7 -6
  147. package/dist/state-VAHBIMS5.js +16 -0
  148. package/dist/{status-VNHIHQ57.js → status-BQEYEG2V.js} +54 -54
  149. package/dist/{statusline-fast-E7RWVREA.js → statusline-fast-NUVHCNRX.js} +4 -2
  150. package/dist/{sync-cmd-5JLJBODH.js → sync-cmd-NBLYEPQG.js} +25 -24
  151. package/dist/update-steps-VGKNGWTZ.js +79 -0
  152. package/dist/{watch-AEWWTUEK.js → watch-IHV4V3HZ.js} +25 -24
  153. package/dist/{work-claim-cmd-GUYOJYH7.js → work-claim-cmd-WGTSU5IT.js} +24 -24
  154. package/dist/{work-cmd-YRPYMGII.js → work-cmd-HKOJU5FJ.js} +18 -17
  155. package/dist/{work-comment-cmd-U5Z6FKEU.js → work-comment-cmd-H3JCWQ2J.js} +21 -20
  156. package/dist/{work-demo-cmd-OLCWTVWM.js → work-demo-cmd-J4AZAIVP.js} +18 -17
  157. package/dist/{work-launch-TTGSHLY4.js → work-launch-LWDQXLGI.js} +1 -1
  158. package/dist/{work-logs-cmd-2OA7ENDU.js → work-logs-cmd-UOO4JVLG.js} +18 -17
  159. package/dist/{work-open-pr-cmd-6GUCDYVM.js → work-open-pr-cmd-QFRDDBAM.js} +20 -19
  160. package/dist/{work-pr-cmd-KK3VQUQI.js → work-pr-cmd-3Q2D5RQT.js} +19 -18
  161. package/dist/{work-proofs-cmd-BUOS5OJC.js → work-proofs-cmd-7Y3HGT7C.js} +21 -20
  162. package/dist/{work-proofs-record-6WLMOK53.js → work-proofs-record-QPUM6DY4.js} +31 -31
  163. package/dist/{work-stop-cmd-VZJX5X4L.js → work-stop-cmd-SD2ZRMSY.js} +18 -17
  164. package/package.json +1 -1
  165. package/dist/agent-setup-DJRQFPDU.js +0 -33
  166. package/dist/bridge-XM4QLKIX.js +0 -8
  167. package/dist/build-ZE5IG3V6.js +0 -18
  168. package/dist/build-disk-GMXDIZU4.js +0 -15
  169. package/dist/builder-LJ3FSB36.js +0 -14
  170. package/dist/caller-YLNJJPFU.js +0 -18
  171. package/dist/chunk-CXFJOX2C.js +0 -144
  172. package/dist/chunk-FGF52V4V.js +0 -137
  173. package/dist/chunk-HCVLP7XA.js +0 -53
  174. package/dist/chunk-KYDEBGJG.js +0 -402
  175. package/dist/chunk-MESOOLF4.js +0 -45
  176. package/dist/chunk-OHQMGLJP.js +0 -113
  177. package/dist/chunk-OUPQTA7N.js +0 -145
  178. package/dist/chunk-VRMXYQWR.js +0 -74
  179. package/dist/connect-cmd-THV7XBVP.js +0 -27
  180. package/dist/docker-5YVUZ3J2.js +0 -14
  181. package/dist/emit-artifact-cmd-H27MFSKH.js +0 -42
  182. package/dist/emit-criteria-cmd-IOUVMB2Q.js +0 -33
  183. package/dist/emit-demo-cmd-WJSS7KU2.js +0 -46
  184. package/dist/exec-client-FGGPQSYQ.js +0 -9
  185. package/dist/find-unit-PRZIFBIK.js +0 -19
  186. package/dist/governing-source-CND5ZZC3.js +0 -39
  187. package/dist/guest-init-WPUS45IN.js +0 -11
  188. package/dist/host-checks-S3B7Z4SY.js +0 -78
  189. package/dist/host-key-O4DFMOSV.js +0 -9
  190. package/dist/image-tag-WBD57QBN.js +0 -10
  191. package/dist/init-ILTX4V56.js +0 -78
  192. package/dist/install-cmd-JKPXIOEY.js +0 -12
  193. package/dist/layout-2ZMCT2D3.js +0 -11
  194. package/dist/loop-KDWDOSMQ.js +0 -89
  195. package/dist/machine-Z6K5XXI6.js +0 -78
  196. package/dist/pending-D2NNV54J.js +0 -9
  197. package/dist/pidfile-FLFVRKVW.js +0 -10
  198. package/dist/record-JMZOXD4R.js +0 -9
  199. package/dist/relay-protocol-5LSWUJCW.js +0 -6
  200. package/dist/runner-env-W2UMHY7P.js +0 -19
  201. package/dist/runner-identity-IIY5UJL3.js +0 -14
  202. package/dist/session-sender-NO4F2IQ5.js +0 -42
  203. package/dist/settings-XB2HYBKO.js +0 -7
  204. package/dist/state-UWIM42JH.js +0 -9
  205. package/dist/update-steps-XGOXDCOS.js +0 -79
  206. package/dist/{chunk-OLM2TIOW.js → chunk-NFZMENCY.js} +1 -1
@@ -1,48 +1,46 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, criterionInputs, uncitedIds, planCriteria, parseJudgeAnswer, inCriteriaOrder, oneLineReason, judgedItems, IdScan, firstInPathOrder, isSearchCandidate } from './chunk-AH6634HC.js';
3
+ import { itemsSentence, criteriaOf, hostItemsOf, loadCitationFinder, testFileMatcher, MAX_TEST_FILE_BYTES, MAX_TEST_FILES, criterionInputs, uncitedIds, planCriteria, parseJudgeAnswer, inCriteriaOrder, oneLineReason, judgedItems, IdScan, firstInPathOrder, isSearchCandidate } from './chunk-FOSYM7TQ.js';
4
4
  import { zodProblem } from './chunk-I3LTIAOR.js';
5
5
  import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
6
- import { upgradedStarterText } from './chunk-JU3VU42K.js';
7
- import { senderPidfile } from './chunk-6A2GEFN3.js';
8
- import { installScrubContext } from './chunk-QIOTIQWD.js';
6
+ import { hasStoredCredential, AGENT_COMMANDS, storeAgentCredential, credentialFromStdin, isAgentName } from './chunk-K7N6LAPC.js';
7
+ import { upgradedStarterText } from './chunk-LHHDX7FB.js';
8
+ import { HELPER_PATH, HELPER_RECORD, DOCKERD_LOG } from './chunk-J2OMKFYB.js';
9
+ import { senderPidfile } from './chunk-YMVRCSKD.js';
10
+ import { installScrubContext } from './chunk-3UFX6KH2.js';
9
11
  import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
10
- import { runnerImageVersion } from './chunk-ALEUIS35.js';
11
- import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-VRMXYQWR.js';
12
+ import { runnerImageVersion } from './chunk-ULBYRPAP.js';
13
+ import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-CSVJGW3I.js';
12
14
  import { receiveFiles } from './chunk-NN33FYXG.js';
13
- import { readDefaultBranchFiles, readDefaultBranchHead, cloneRepository, buildRepositoryImage, fetchCommit, readBranchHead, diffBetween, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-W7I65BKE.js';
14
- import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-KB5B6ZT5.js';
15
- import { currentCliBuild } from './chunk-OGFGZQA3.js';
16
- import { vmExecArgs, runExec, execCapture, waitForAgent } from './chunk-46OBCATR.js';
17
- import { describeCallFailure, shortClaim, retrySend, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, formatClock, stageGovernedContext, keptContextTree, removeStagedContext, WORKFLOW_PERMISSION_REASON, refusalCode, resolveGoverningSource, prefetchGovernedContext, controlPlaneTokenFailure, keepStagedContext, pinnedSourceOf, shimScript } from './chunk-F2LPX2HS.js';
18
- import { HELPER_PATH, HELPER_RECORD, DOCKERD_LOG } from './chunk-55PYF6S2.js';
15
+ import { readDefaultBranchFiles, readDefaultBranchHead, cloneRepository, buildRepositoryImage, fetchCommit, readBranchHead, diffBetween, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-TJIFYV2Z.js';
16
+ import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-ZSRMJOAK.js';
19
17
  import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
20
- import { socketPathProblem, vsockLinks, linkVsockSockets, GUEST_CID, LEASE_LINK } from './chunk-UZGQT6OF.js';
21
- import { writeDockerClientConfig } from './chunk-MKSZHT6S.js';
22
- import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-D2OTBS47.js';
23
- import { runnerCredentialProblem, builtinKind, keyRunnerFactory, optionalEgress, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, allowHostProblem, systemClock, emptyEgressCounts, hostAllowed, imageBuildOf, DEFAULT_SAVED_STATE_MAX_BYTES } from './chunk-RIIPBJK6.js';
24
- import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-MXIFRYLA.js';
25
- import { writeJobFile, readJobFile, spawnRun, RUNNER_LABEL, BUILD_LABEL, NETWORK_HELPER_MEMORY, createDockerHost, builderSpec, containerExecArgs, childEnvironment, readDu, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, readJobFileChecked, NETWORK_READY_FILE, networkHelperName, runnerLabelValue, prepareRunArgs, containerRunArgs, JUDGE_MAX_TURNS, parseSize, homeCopyRunArgs, networkHelperRunArgs, JUDGE_DIR, HASH_ARGV, parseProgramHash, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, COMMAND_DIR, JUDGE_PROGRAM, MAX_ITEMS_BYTES, JUDGE_ITEMS, JUDGE_REPORT, identityRunArgs, SAVED_STATE_LABEL } from './chunk-OEBFKPHK.js';
26
- import { universalImagePending, RecipeError, writeSanitizedRecipe, classifyProperties, DOCKER_FEATURE } from './chunk-CIUD3436.js';
27
- import { firecrackerArch, MICROVM_ARCHES, FIRECRACKER_VERSION, hostHelperPinned, builderDiskPinned, guestAssetsPinned, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, BUILDER_DISK_VERSION, networkHelperPinned, NETWORK_HELPER_SHA256, universalImagePinned, UNIVERSAL_IMAGE, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, GH_VERSION, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_FFMPEG_BASE_URL, VOICE_PACK_FILES, BUILDER_DISK_SHA256, BUILDER_DISK_BASE_URL, DEFAULT_BASE_IMAGE, CLAUDE_CODE_VERSION } from './chunk-OUPQTA7N.js';
28
- import { postJson, WorkCommandError, getJson, isSignatureRefusal } from './chunk-SPXVFFQV.js';
18
+ import { currentCliBuild } from './chunk-OGFGZQA3.js';
19
+ import { vmExecArgs, runExec, execCapture, waitForAgent } from './chunk-HRHWA6TZ.js';
20
+ import { socketPathProblem, vsockLinks, linkVsockSockets, GUEST_CID, LEASE_LINK } from './chunk-H2NJG3TE.js';
21
+ import { describeCallFailure, shortClaim, retrySend, commandWithShim, logStamp, createRunnerLog, formatDuration, removeKeptContext, formatClock, stageGovernedContext, keptContextTree, removeStagedContext, WORKFLOW_PERMISSION_REASON, refusalCode, resolveGoverningSource, prefetchGovernedContext, controlPlaneTokenFailure, keepStagedContext, pinnedSourceOf, shimScript } from './chunk-3YEPLVNW.js';
22
+ import { writeDockerClientConfig } from './chunk-2YC3TXWX.js';
23
+ import { runnerCredentialProblem, builtinKind, keyRunnerFactory, optionalEgress, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, egressSummary, DEFAULT_CHECK_TIME_LIMIT_MINUTES, DEFAULT_SETUP_MINUTES, allowHostProblem, systemClock, emptyEgressCounts, hostAllowed, imageBuildOf, DEFAULT_SAVED_STATE_MAX_BYTES } from './chunk-WACPWYMH.js';
24
+ import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-Y4E7IS7H.js';
25
+ import { writeJobFile, readJobFile, spawnRun, RUNNER_LABEL, BUILD_LABEL, NETWORK_HELPER_MEMORY, createDockerHost, builderSpec, containerExecArgs, childEnvironment, readDu, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, readJobFileChecked, NETWORK_READY_FILE, networkHelperName, runnerLabelValue, prepareRunArgs, containerRunArgs, JUDGE_MAX_TURNS, parseSize, homeCopyRunArgs, networkHelperRunArgs, JUDGE_DIR, HASH_ARGV, parseProgramHash, identityScript, identityArgs, parseIdentity, mountableHome, homeCopyScript, homeCopyArgs, COMMAND_DIR, JUDGE_PROGRAM, MAX_ITEMS_BYTES, JUDGE_ITEMS, JUDGE_REPORT, identityRunArgs, SAVED_STATE_LABEL } from './chunk-CDG475ZP.js';
26
+ import { universalImagePending, RecipeError, writeSanitizedRecipe, classifyProperties, DOCKER_FEATURE } from './chunk-BZSJ77MO.js';
27
+ import { postJson, WorkCommandError, getJson, isSignatureRefusal } from './chunk-AQE6E54X.js';
29
28
  import { sanitizeTerminal, planArtifactUpload } from './chunk-P6PHY33P.js';
29
+ import { scrubText, MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, forkFor, parseTranscript, scrubDeep } from './chunk-6KH3NMIT.js';
30
30
  import { readCloudConfig } from './chunk-HWVMRETT.js';
31
- import { signerFor } from './chunk-4DJZSNVT.js';
32
- import { sharedSkillNames, skillConflictMessage } from './chunk-FGF52V4V.js';
33
- import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
34
- import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot } from './chunk-CXFJOX2C.js';
35
- import { scrubText, MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, forkFor, parseTranscript, scrubDeep } from './chunk-5GHJFETA.js';
31
+ import { signerFor } from './chunk-IKFAJTLZ.js';
32
+ import { sharedSkillNames, skillConflictMessage } from './chunk-6JLYU322.js';
33
+ import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-BSPJI5T7.js';
34
+ import { vmAssetsDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, buildDir, jobsDir, storeScopes, spoolDir, orgStoreIn, rootfsDir, imagesDir, sessionsDir, builderCacheDiskPath, buildsDir, ghConfigDir, runnerDirOfBuild, mirrorDir, orgHomeDir, jobConsolePath, vsockPath, builderConsolePath, rootfsPathFor, diskTemplatesDir, deliveryDir, SHIM_DIR } from './chunk-DTCTXDJP.js';
35
+ import { CHECKOUT_DIR, JOB_MOUNT, buildEnvironment, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, withHooksPath, startBuildServices, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, repositoriesOf, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, checkEnvironment, withMiseVariables, checkoutPath, EVAL_INPUT_DIR, isMiseVariableAllowed, BUILD_HOME, primaryOf } from './chunk-CXJC3JLN.js';
36
+ import { firecrackerArch, MICROVM_ARCHES, FIRECRACKER_VERSION, hostHelperPinned, builderDiskPinned, guestAssetsPinned, runnerAgentNamed, credentialForms, orList, credentialShapes, credentialAgent, agentCredential, strippedVariables, builtInEnvironment, builtInNames, buildAgent, AGENT_CREDENTIAL_MISSING, RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON, UNKNOWN_TRANSPORT_REASON, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, BUILDER_DISK_VERSION, credentialHandOffKey, runnerAgents, currentAgentCredential, removedAgentCredentialValues, managedAgentCredential, RELAY_USER, realFdStorePort, networkHelperPinned, NETWORK_HELPER_SHA256, universalImagePinned, UNIVERSAL_IMAGE, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, JOIN_WAIT_MS, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, GH_VERSION, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_FFMPEG_BASE_URL, VOICE_PACK_FILES, BUILDER_DISK_SHA256, BUILDER_DISK_BASE_URL, DEFAULT_BASE_IMAGE, MAX_OPEN_STREAMS, STREAM_RESET_RATE, STREAM_RESET_BURST, STREAM_WINDOW, SESSION_WINDOW, targetOfPath, agentVersionOf, fdName, RELAY_ID, DOCKER_DESKTOP_REASON } from './chunk-DTQPDMHG.js';
37
+ import { defaultAgents, parsePolicy, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot, orderSessions, extractFacts, sessionsToTimeline } from './chunk-I6U6QPN6.js';
38
+ import { CheckItemsSchema, downconvertSession } from './chunk-WUKLQWGY.js';
36
39
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
37
40
  import { resolveVersion } from './chunk-RA3O54FC.js';
38
- import { parsePolicy, orderSessions, extractFacts, sessionsToTimeline } from './chunk-24FEVLX7.js';
39
- import { CheckItemsSchema, downconvertSession } from './chunk-WUKLQWGY.js';
40
41
  import { homeFromEnv } from './chunk-352DHUTP.js';
41
- import { vmAssetsDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, buildDir, jobsDir, storeScopes, spoolDir, orgStoreIn, rootfsDir, imagesDir, sessionsDir, builderCacheDiskPath, buildsDir, ghConfigDir, runnerDirOfBuild, mirrorDir, orgHomeDir, jobConsolePath, vsockPath, builderConsolePath, rootfsPathFor, diskTemplatesDir, deliveryDir, SHIM_DIR } from './chunk-WT7J2627.js';
42
- import { CHECKOUT_DIR, CLAUDE_CREDENTIAL_VARIABLES, claudeCredential, JOB_MOUNT, buildEnvironment, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, repositoriesOf, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, currentClaudeCredential, removedClaudeCredentialValues, managedClaudeCredential, realFdStorePort, checkEnvironment, withMiseVariables, checkoutPath, EVAL_INPUT_DIR, isMiseVariableAllowed, BUILD_HOME, primaryOf, fdName } from './chunk-GANAOCHR.js';
43
- import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON, UNKNOWN_TRANSPORT_REASON, RELAY_USER, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, JOIN_WAIT_MS, MAX_OPEN_STREAMS, STREAM_RESET_RATE, STREAM_RESET_BURST, STREAM_WINDOW, SESSION_WINDOW, targetOfPath, RELAY_ID, DOCKER_DESKTOP_REASON } from './chunk-MESOOLF4.js';
44
42
  import { randomUUID, randomBytes, createHash } from 'crypto';
45
- import { mkdirSync, existsSync, readFileSync, mkdtempSync, rmSync, statSync, appendFileSync, writeFileSync, readdirSync, accessSync, constants, openSync, closeSync, chmodSync, renameSync, rmdirSync, createReadStream, lstatSync, unlinkSync, realpathSync, writeSync, truncateSync, cpSync, fstatSync, readSync, createWriteStream, copyFileSync, linkSync } from 'fs';
43
+ import { rmSync, mkdirSync, existsSync, readFileSync, mkdtempSync, statSync, appendFileSync, writeFileSync, readdirSync, accessSync, constants, openSync, closeSync, chmodSync, renameSync, rmdirSync, createReadStream, lstatSync, unlinkSync, realpathSync, writeSync, truncateSync, cpSync, fstatSync, readSync, createWriteStream, copyFileSync, linkSync } from 'fs';
46
44
  import { join, dirname, isAbsolute, delimiter, sep, basename, relative, resolve } from 'path';
47
45
  import { Readable, Transform, Duplex, PassThrough } from 'stream';
48
46
  import { spawn, spawnSync } from 'child_process';
@@ -84,8 +82,22 @@ function keptSessionDir(configPath, organizationId, workItemId) {
84
82
  if (!WORK_ITEM_ID.test(workItemId)) throw new Error(`cannot keep a session for the work item ${JSON.stringify(workItemId)}`);
85
83
  return join(sessionsDir(configPath, organizationId), workItemId);
86
84
  }
85
+ function scrubFilesUnder(dir, scrub) {
86
+ for (const name of readdirSync(dir)) {
87
+ const path = join(dir, name);
88
+ const stat = lstatSync(path);
89
+ if (stat.isDirectory()) scrubFilesUnder(path, scrub);
90
+ else if (stat.isFile()) {
91
+ const text2 = readFileSync(path, "utf8");
92
+ const scrubbed = scrub(text2);
93
+ if (typeof scrubbed !== "string") throw new Error(`the scrub of ${name} returned no text`);
94
+ if (scrubbed !== text2) writeFileSync(path, scrubbed);
95
+ } else throw new Error(`${name} is not a regular file, so it cannot be scrubbed`);
96
+ }
97
+ }
87
98
  async function keepSession(input) {
88
- const { dir, meta } = input;
99
+ const { dir } = input;
100
+ const meta = input.scrub === void 0 ? input.meta : { ...input.meta, scrubbed: true };
89
101
  if (!SESSION_ID.test(meta.sessionId)) throw new Error(`cannot keep the session ${JSON.stringify(meta.sessionId)}`);
90
102
  const parent = dirname(dir);
91
103
  mkdirSync(parent, { recursive: true, mode: 448 });
@@ -101,6 +113,7 @@ async function keepSession(input) {
101
113
  transcript = void 0;
102
114
  }
103
115
  if (transcript === void 0 || !transcript.isFile()) throw new Error(`the stream holds no transcript of session ${meta.sessionId}`);
116
+ if (input.scrub !== void 0) scrubFilesUnder(incoming, input.scrub());
104
117
  writeFileSync(join(incoming, META_FILE), JSON.stringify(meta), { mode: 384 });
105
118
  let hadOlder = true;
106
119
  try {
@@ -134,7 +147,7 @@ function readKeptSession(dir) {
134
147
  } catch {
135
148
  return void 0;
136
149
  }
137
- return { meta: { sessionId: parsed.sessionId, claimId: parsed.claimId, queue: parsed.queue, keptAt: parsed.keptAt }, transcript };
150
+ return { meta: { sessionId: parsed.sessionId, claimId: parsed.claimId, queue: parsed.queue, keptAt: parsed.keptAt, ...parsed.scrubbed === true ? { scrubbed: true } : {} }, transcript };
138
151
  }
139
152
  var BLOCK = 512;
140
153
  function tarHeader(path, size, type, mtimeMs) {
@@ -212,7 +225,12 @@ async function prepareResume(input) {
212
225
  const fresh = (resume) => ({ sessionId, resume, env: { [SESSION_ID_VARIABLE]: sessionId } });
213
226
  if (input.queue !== "amend") return fresh(void 0);
214
227
  const dir = keptSessionDir(input.configPath, input.organizationId, input.workItemId);
215
- const kept = readKeptSession(dir);
228
+ let kept = readKeptSession(dir);
229
+ if (kept !== void 0 && input.requireScrubNote === true && kept.meta.scrubbed !== true) {
230
+ rmSync(dir, { recursive: true, force: true });
231
+ input.log("the saved session was kept before the runner scrubbed sessions, so it is removed");
232
+ kept = void 0;
233
+ }
216
234
  const decision = resumeDecision({ queue: input.queue, builtin: input.builtin, kept: kept?.meta });
217
235
  if (!decision.resumed) {
218
236
  input.log(`agent job starts fresh because ${REASON_TEXT[decision.reason]}`);
@@ -348,8 +366,9 @@ function managedClaudeKeyValuesFor(jobDir) {
348
366
  const key = everHeldBy.get(jobDir);
349
367
  return key === void 0 ? [] : [key];
350
368
  }
351
- function hasClaudeCredential(config, hostEnv, jobDir) {
352
- return config.managed === true ? managedClaudeKeyFor(jobDir) !== void 0 : claudeCredential(hostEnv) !== void 0;
369
+ function hasClaudeCredential(config, hostEnv, jobDir, agents) {
370
+ if (buildAgent(agents)?.adapter.credentials === void 0) return true;
371
+ return config.managed === true ? managedClaudeKeyFor(jobDir) !== void 0 : agentCredential(hostEnv, {}, agents) !== void 0;
353
372
  }
354
373
 
355
374
  // src/runner/managed-build-settings.ts
@@ -1694,10 +1713,12 @@ function isolationNote(machine) {
1694
1713
  const needs = reach !== void 0 ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later: ${reach}, then set both hooks to builtin:container.` : machine.platform === "windows" ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later inside WSL2: install it there, run the runner from a WSL2 shell, and set both hooks to builtin:container.` : `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later on Linux or WSL2. Once it is installed, set both hooks to builtin:container.`;
1695
1714
  return `This machine has ${has}, so builds run as processes under this user (isolation: shared-user), through the tunnel. ${needs}`;
1696
1715
  }
1697
- function processRefusal(machine) {
1716
+ function processRefusal(machine, agents) {
1717
+ const agent = credentialAgent(agents);
1718
+ const credential = agent === void 0 ? "credential" : `${credentialForms(agent.descriptor).label} credential`;
1698
1719
  const reach = reachDockerStep(machine);
1699
1720
  const needs = machine.platform === "darwin" ? "Isolated builds on a Mac run in the runner image on Docker Desktop (https://docs.outerlayer.ai/run-the-runner-in-a-container) or in a Linux VM: run this again with --vm." : reach !== void 0 ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later: ${reach}, then run this again.` : machine.platform === "windows" ? `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later inside WSL2: install it there, then run this again from a WSL2 shell.` : `Isolated builds need Docker Engine ${MIN_ENGINE_MAJOR} or later on Linux or WSL2: install it, then run this again.`;
1700
- return `This machine has ${describeMachineDocker(machine)}, so it cannot isolate a build. ${needs} To run builds as processes under this user instead, where a build can read this user's files and the runner's Claude credential, run this again with --allow-process-builds.`;
1721
+ return `This machine has ${describeMachineDocker(machine)}, so it cannot isolate a build. ${needs} To run builds as processes under this user instead, where a build can read this user's files and the runner's ${credential}, run this again with --allow-process-builds.`;
1701
1722
  }
1702
1723
  function isPlaceholderCommand(command) {
1703
1724
  return command === UNMARKED_PLACEHOLDER_COMMAND || command.includes(PLACEHOLDER_MARKER);
@@ -1714,17 +1735,18 @@ function readConfigObject(configPath) {
1714
1735
  throw new RunnerInitError(`${configPath}: not valid JSON (${err instanceof Error ? err.message : String(err)})`);
1715
1736
  }
1716
1737
  }
1717
- function handedCredential(value) {
1738
+ function handedCredential(value, agents) {
1718
1739
  if (value === void 0) return void 0;
1719
- if (typeof value !== "string") throw new RunnerInitError("the config on stdin carries a claudeCredential that is not text.");
1720
- return credentialFromStdin(value);
1740
+ const key = credentialHandOffKey(agents);
1741
+ if (typeof value !== "string") throw new RunnerInitError(`the config on stdin carries a ${key} that is not text.`);
1742
+ return credentialFromStdin(value, agents);
1721
1743
  }
1722
1744
  function handedAgent(value) {
1723
1745
  if (value === void 0) return void 0;
1724
1746
  if (!isAgentName(value)) throw new RunnerInitError("the config on stdin names an agent runner init does not know.");
1725
1747
  return value;
1726
1748
  }
1727
- function parseStdinConfig(configPath, text2) {
1749
+ function parseStdinConfig(configPath, text2, agents) {
1728
1750
  if (existsSync(configPath)) {
1729
1751
  throw new RunnerInitError(
1730
1752
  `${configPath}: a config file is already here, so the runner key in it is not replaced. Remove it, or delete the VM and start again.`
@@ -1739,10 +1761,11 @@ function parseStdinConfig(configPath, text2) {
1739
1761
  const problem = runnerCredentialProblem(config);
1740
1762
  if (problem !== void 0) throw new RunnerInitError(`the config on stdin: ${problem.field} ${problem.reason}.`);
1741
1763
  const carried = config.runner;
1742
- const credential = handedCredential(config.claudeCredential);
1764
+ const key = credentialHandOffKey(agents);
1765
+ const credential = handedCredential(config[key], agents);
1743
1766
  const agent = handedAgent(config.agent);
1744
1767
  delete config.runner;
1745
- delete config.claudeCredential;
1768
+ delete config[key];
1746
1769
  delete config.agent;
1747
1770
  return { config, carried, credential, agent };
1748
1771
  }
@@ -1755,6 +1778,7 @@ function prepareRunnerInit(configPath, opts = {}) {
1755
1778
  let credential = opts.credential;
1756
1779
  let agent = opts.agent;
1757
1780
  let needsKey = false;
1781
+ const agents = opts.agents ?? defaultAgents();
1758
1782
  if (opts.configFromStdin === void 0) {
1759
1783
  config = opts.keyFromLogin === true && !existsSync(configPath) ? {} : readConfigObject(configPath);
1760
1784
  if (config.runner !== void 0) {
@@ -1764,7 +1788,7 @@ function prepareRunnerInit(configPath, opts = {}) {
1764
1788
  const problem = needsKey ? void 0 : runnerCredentialProblem(config);
1765
1789
  if (problem !== void 0) throw new RunnerInitError(`${configPath}: ${problem.field} ${problem.reason}.`);
1766
1790
  } else {
1767
- const handed = parseStdinConfig(configPath, opts.configFromStdin);
1791
+ const handed = parseStdinConfig(configPath, opts.configFromStdin, agents);
1768
1792
  ({ config, carried } = handed);
1769
1793
  credential ??= handed.credential;
1770
1794
  agent ??= handed.agent;
@@ -1775,16 +1799,18 @@ function prepareRunnerInit(configPath, opts = {}) {
1775
1799
  throw new RunnerInitError(`the VM has ${describeMachineDocker(machine)}, but the runner in it needs container builds: ${fix}, then run this again.`);
1776
1800
  }
1777
1801
  const hooks = opts.requireContainer !== true && supportsMicroVmBuilds(machine) ? "builtin:vm" : supportsContainerBuilds(machine) ? "builtin:container" : "builtin:process";
1778
- if (hooks === "builtin:process" && opts.allowProcess !== true) throw new RunnerInitError(processRefusal(machine));
1779
- if (agent === "claude" && credential === void 0 && opts.credentialInEnvironment !== true && !hasStoredCredential(configPath)) {
1802
+ if (hooks === "builtin:process" && opts.allowProcess !== true) throw new RunnerInitError(processRefusal(machine, agents));
1803
+ const named = agent === void 0 ? void 0 : runnerAgentNamed(agent, agents);
1804
+ if (named !== void 0 && credential === void 0 && opts.credentialInEnvironment !== true && !hasStoredCredential(configPath, agents)) {
1805
+ const forms = credentialForms(named.descriptor);
1780
1806
  throw new RunnerInitError(
1781
- "--agent claude needs Claude's credential, and none was piped on stdin or is in the claude.env beside the config. Pipe a token from `claude setup-token`, or an Anthropic API key: printf '%s' \"$CLAUDE_CODE_OAUTH_TOKEN\" | outerlayer runner init --agent claude"
1807
+ `--agent ${forms.runnerName} needs ${forms.possessive} credential, and none was piped on stdin or is in the ${forms.envFile} beside the config. Pipe ${orList(credentialShapes(named.descriptor).map((shape) => shape.phrase))}: printf '%s' "$${forms.variables[0]}" | outerlayer runner init --agent ${forms.runnerName}`
1782
1808
  );
1783
1809
  }
1784
- return { configPath, config, carried, credential, agent, machine, hooks, needsKey, host: opts.host };
1810
+ return { configPath, config, carried, credential, agent, agents, machine, hooks, needsKey, host: opts.host };
1785
1811
  }
1786
1812
  function writeRunnerInit(prepared, runnerKey) {
1787
- const { configPath, config, carried, credential, agent, machine, hooks, host } = prepared;
1813
+ const { configPath, config, carried, credential, agent, agents, machine, hooks, host } = prepared;
1788
1814
  if (prepared.needsKey && runnerKey === void 0) {
1789
1815
  throw new RunnerInitError(`${configPath}: apiKey is missing, and no runner key was pasted.`);
1790
1816
  }
@@ -1811,7 +1837,7 @@ function writeRunnerInit(prepared, runnerKey) {
1811
1837
  };
1812
1838
  if (host !== void 0) delete config.runner.host;
1813
1839
  mkdirSync(dirname(configPath), { recursive: true });
1814
- const stored = credential === void 0 ? void 0 : { variable: credential.variable, path: storeClaudeCredential(configPath, credential) };
1840
+ const stored = credential === void 0 ? void 0 : { variable: credential.variable, path: storeAgentCredential(configPath, credential, agents) };
1815
1841
  writeFileSync(configPath, `${JSON.stringify(config, null, 2)}
1816
1842
  `, { mode: RUNNER_FILE_MODE });
1817
1843
  return { configPath, hooks, ...hooks === "builtin:process" ? { note: isolationNote(machine) } : {}, credential: stored };
@@ -1861,31 +1887,43 @@ function formerSkillProblem(queues) {
1861
1887
  const keys = queues.map((queue) => `runner.commands.${queue}`).join(", ");
1862
1888
  return `${keys} ${queues.length === 1 ? "starts" : "start"} /amend, which is now /outerlayer-amend. The runner runs /outerlayer-amend in its place; edit the config to say so`;
1863
1889
  }
1864
- function needsClaudeCredential(hooks) {
1890
+ function needsAgentCredential(hooks) {
1865
1891
  return builtinKind(hooks.provision) !== "own";
1866
1892
  }
1867
- var CREDENTIAL_FIX = "Run `claude setup-token`, then pipe the token it prints (or an Anthropic API key) to `outerlayer runner init --agent claude`, which stores it in the claude.env beside the config. Or start the runner with CLAUDE_CODE_OAUTH_TOKEN (or ANTHROPIC_API_KEY) set";
1868
- function claudeCredentialCheck(env, options = {}) {
1869
- const name = "Claude credential";
1893
+ function credentialFix(forms, others) {
1894
+ const [first, ...rest] = forms.variables;
1895
+ const alternative = others.length === 0 ? "" : ` (or ${others.join(" or ")})`;
1896
+ const alternativeVariables = rest.length === 0 ? "" : ` (or ${rest.join(" or ")})`;
1897
+ return `Run \`${forms.setupCommand}\`, then pipe the token it prints${alternative} to \`outerlayer runner init --agent ${forms.runnerName}\`, which stores it in the ${forms.envFile} beside the config. Or start the runner with ${first}${alternativeVariables} set`;
1898
+ }
1899
+ function unset(variables) {
1900
+ return variables.length === 1 ? `${variables[0]} is not set` : `neither ${variables.join(" nor ")} is set`;
1901
+ }
1902
+ function agentCredentialCheck(env, options = {}, agents = defaultAgents()) {
1903
+ const agent = credentialAgent(agents);
1904
+ if (agent === void 0) return { name: "Agent credential", status: "pass", detail: "no agent takes a credential" };
1905
+ const forms = credentialForms(agent.descriptor);
1906
+ const name = `${forms.label} credential`;
1907
+ const fix = credentialFix(forms, credentialShapes(agent.descriptor).slice(1).map((shape) => shape.phrase));
1870
1908
  if (options.service !== void 0) {
1871
1909
  const { unit, variables } = options.service;
1872
1910
  if (variables.length === 0) {
1873
1911
  return {
1874
1912
  name,
1875
1913
  status: "fail",
1876
- detail: `the service ${unit} has no Claude credential: neither ${CLAUDE_CREDENTIAL_VARIABLES.slice(0, 2).join(" nor ")} is set in its claude.env or runner.env, so every build fails at provision as agent_credential_missing`,
1877
- fix: `${CREDENTIAL_FIX}, then restart the service: sudo systemctl restart ${unit}.`
1914
+ detail: `the service ${unit} has no ${forms.label} credential: ${unset(forms.variables)} in its ${forms.envFile} or runner.env, so every build fails at provision as agent_credential_missing`,
1915
+ fix: `${fix}, then restart the service: sudo systemctl restart ${unit}.`
1878
1916
  };
1879
1917
  }
1880
- return { name, status: "pass", detail: `${variables[0]} is set in the claude.env or runner.env of the service ${unit}` };
1918
+ return { name, status: "pass", detail: `${variables[0]} is set in the ${forms.envFile} or runner.env of the service ${unit}` };
1881
1919
  }
1882
- const held3 = claudeCredential(env, { ignoreHeld: options.ignoreHeld === true });
1920
+ const held3 = agentCredential(env, { ignoreHeld: options.ignoreHeld === true }, agents);
1883
1921
  if (held3 === void 0) {
1884
1922
  return {
1885
1923
  name,
1886
1924
  status: "fail",
1887
- detail: `neither ${CLAUDE_CREDENTIAL_VARIABLES.slice(0, 2).join(" nor ")} is set, so every build fails at provision as agent_credential_missing`,
1888
- fix: `${CREDENTIAL_FIX}.`
1925
+ detail: `${unset(forms.variables)}, so every build fails at provision as agent_credential_missing`,
1926
+ fix: `${fix}.`
1889
1927
  };
1890
1928
  }
1891
1929
  const sameVariables = options.shell === true ? "; the runner must be started with the same variable" : "";
@@ -3560,7 +3598,7 @@ async function provisionMicroVmOnce(input, allowRestore) {
3560
3598
  const tag = itemTag({ item: item.number, organizationId: input.organizationId, claimId: input.claimId });
3561
3599
  const logPath = join(jobDir, "provision.log");
3562
3600
  const fail = (reason) => ({ ok: false, reason });
3563
- if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
3601
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir, runtime.agents)) return fail(AGENT_CREDENTIAL_MISSING);
3564
3602
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
3565
3603
  const primary = primaryOf(repositories);
3566
3604
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -3652,6 +3690,7 @@ async function provisionMicroVmOnce(input, allowRestore) {
3652
3690
  repository,
3653
3691
  repositories,
3654
3692
  hostEnv: runtime.hostEnv,
3693
+ agents: runtime.agents,
3655
3694
  containerEnv: report.apply.containerEnv,
3656
3695
  builtIns: true,
3657
3696
  factoryVariables: factoryVariablesOf(config, jobDir)
@@ -3718,7 +3757,7 @@ async function provisionMicroVmOnce(input, allowRestore) {
3718
3757
  } catch (err) {
3719
3758
  return bail(`the tunnel could not start: ${describeCallFailure(err)}`);
3720
3759
  }
3721
- const links = vsockLinks({ destinations: config.build?.destinations?.length ?? 0, builtIns: true });
3760
+ const links = vsockLinks({ destinations: config.build?.destinations?.length ?? 0, builtIns: true }, runtime.agents);
3722
3761
  const served = input.leaseTimeLeftMs === void 0 ? links : [...links, LEASE_LINK];
3723
3762
  let leaseServer;
3724
3763
  if (input.leaseTimeLeftMs !== void 0) {
@@ -3886,7 +3925,7 @@ async function provisionMicroVmOnce(input, allowRestore) {
3886
3925
  if (changed !== void 0) return giveUpState(changed);
3887
3926
  }
3888
3927
  const tools = await asRoot(runtime, state, ["cat", "/opt/outerlayer/tools.json"]);
3889
- const agentVersion = agentVersionOf(tools.status === 0 ? tools.stdout : "");
3928
+ const agentVersion = agentVersionOf(tools.status === 0 ? tools.stdout : "", runtime.agents);
3890
3929
  environment.agentVersion = agentVersion;
3891
3930
  const program = await asRoot(runtime, state, [...HASH_ARGV]);
3892
3931
  const hashed = program.status === 0 ? parseProgramHash(program.stdout) : void 0;
@@ -3992,14 +4031,6 @@ async function waitForDocker(runtime, state, agentUser, now) {
3992
4031
  const detail = [lastError, log === "" ? "" : `the daemon's log ends: ${log}`].filter((part) => part !== "");
3993
4032
  return `the Docker daemon in the microVM did not answer docker info within ${DOCKER_WAIT_SECONDS} seconds${detail.length === 0 ? "" : `; ${detail.join("; ")}`}`;
3994
4033
  }
3995
- function agentVersionOf(toolsJson) {
3996
- try {
3997
- const version = JSON.parse(toolsJson).claudeCodeVersion;
3998
- if (typeof version === "string" && version !== "") return version;
3999
- } catch {
4000
- }
4001
- return CLAUDE_CODE_VERSION;
4002
- }
4003
4034
  function vmExecFor(input, argv) {
4004
4035
  const state = input.job.microvm;
4005
4036
  const built = buildEnvironment({
@@ -4010,6 +4041,7 @@ function vmExecFor(input, argv) {
4010
4041
  repository: state.repository,
4011
4042
  repositories: input.job.repositories,
4012
4043
  hostEnv: input.runtime.hostEnv,
4044
+ agents: input.runtime.agents,
4013
4045
  containerEnv: state.containerEnv ?? {},
4014
4046
  unpinnedRuntimes: state.unpinnedRuntimes,
4015
4047
  missingSetupScripts: state.missingSetupScripts,
@@ -4046,6 +4078,7 @@ async function startMicroVmCommand(input) {
4046
4078
  repository: state.repository,
4047
4079
  repositories: input.job.repositories,
4048
4080
  hostEnv: input.runtime.hostEnv,
4081
+ agents: input.runtime.agents,
4049
4082
  containerEnv: state.containerEnv ?? {},
4050
4083
  unpinnedRuntimes: state.unpinnedRuntimes,
4051
4084
  missingSetupScripts: state.missingSetupScripts,
@@ -4097,6 +4130,7 @@ async function runCliInMicroVm(input, argv, logName, goneReason) {
4097
4130
  repository: state.repository,
4098
4131
  repositories: job.repositories,
4099
4132
  hostEnv: runtime.hostEnv,
4133
+ agents: runtime.agents,
4100
4134
  containerEnv: state.containerEnv ?? {},
4101
4135
  unpinnedRuntimes: state.unpinnedRuntimes,
4102
4136
  missingSetupScripts: state.missingSetupScripts,
@@ -5462,7 +5496,7 @@ function onceNote(write) {
5462
5496
  function attemptNote(log, tag) {
5463
5497
  return onceNote((line2) => log.line(`${tag} ${line2}`));
5464
5498
  }
5465
- function hostCommandEnvironment(base, build, config, hooksPath, note) {
5499
+ function hostCommandEnvironment(base, build, config, hooksPath, note, agents = defaultAgents()) {
5466
5500
  let env = { ...base };
5467
5501
  if (build.exec !== void 0) {
5468
5502
  Object.assign(env, execProxyEnvironment(build));
@@ -5480,9 +5514,9 @@ function hostCommandEnvironment(base, build, config, hooksPath, note) {
5480
5514
  if (address !== void 0) Object.assign(env, destinationEnvironment([destination], () => address));
5481
5515
  });
5482
5516
  if (build.builtIns === true) {
5483
- const credential = claudeCredential(base);
5484
- for (const name of CLAUDE_CREDENTIAL_VARIABLES) delete env[name];
5485
- Object.assign(env, builtInEnvironment((name) => `http://127.0.0.1:${portOf(name) ?? 0}`, credential));
5517
+ const credential = agentCredential(base, {}, agents);
5518
+ for (const name of strippedVariables(agents)) delete env[name];
5519
+ Object.assign(env, builtInEnvironment((name) => `http://127.0.0.1:${portOf(name) ?? 0}`, credential, agents));
5486
5520
  }
5487
5521
  if (build.exec === void 0 && hooksPath !== void 0) env = withHooksPath(env, hooksPath);
5488
5522
  return env;
@@ -5490,6 +5524,7 @@ function hostCommandEnvironment(base, build, config, hooksPath, note) {
5490
5524
  async function startHostServices(input) {
5491
5525
  const { runtime, config, build } = input;
5492
5526
  const destinations = config.build?.destinations ?? [];
5527
+ const builtIns = builtInNames(runtime.agents);
5493
5528
  const services = await startBuildServices({
5494
5529
  startTunnel: runtime.startTunnel,
5495
5530
  tunnelOptions: runtime.tunnelOptions,
@@ -5500,11 +5535,11 @@ async function startHostServices(input) {
5500
5535
  ...optionalEgress(config),
5501
5536
  serve: input.process ? "tcp" : "both",
5502
5537
  proxy: input.process,
5503
- ...input.process ? { builtIns: { gatewayUrl: config.url, itemKey: input.itemKey, claudeUpstream: runtime.claudeUpstream } } : {},
5538
+ ...input.process ? { builtIns: { gatewayUrl: config.url, itemKey: input.itemKey, upstreams: runtime.upstreams, agents: runtime.agents } } : {},
5504
5539
  ports: {
5505
5540
  proxy: build.proxyPort,
5506
- destinations: build.destinations?.filter((d) => !BUILT_IN_NAMES.includes(d.name)).map((d) => d.port),
5507
- builtIns: Object.fromEntries((build.destinations ?? []).filter((d) => BUILT_IN_NAMES.includes(d.name)).map((d) => [d.name, d.port]))
5541
+ destinations: build.destinations?.filter((d) => !builtIns.includes(d.name)).map((d) => d.port),
5542
+ builtIns: Object.fromEntries((build.destinations ?? []).filter((d) => builtIns.includes(d.name)).map((d) => [d.name, d.port]))
5508
5543
  },
5509
5544
  hostEnv: runtime.hostEnv,
5510
5545
  destinationOptions: runtime.destinationOptions,
@@ -5818,7 +5853,7 @@ function buildReleaseLog(jobDirPath, endStage, scrub) {
5818
5853
  var ENDED = "ended before provision finished";
5819
5854
  async function provisionProcess(input) {
5820
5855
  const { config, runtime, item, repository, jobDir } = input;
5821
- if (claudeCredential(runtime.hostEnv) === void 0) return { ok: false, reason: AGENT_CREDENTIAL_MISSING };
5856
+ if (buildAgent(runtime.agents)?.adapter.credentials !== void 0 && agentCredential(runtime.hostEnv, {}, runtime.agents) === void 0) return { ok: false, reason: AGENT_CREDENTIAL_MISSING };
5822
5857
  if (repository === void 0 || repository === null || repository === "") {
5823
5858
  return { ok: false, reason: "the work item names no repository to clone" };
5824
5859
  }
@@ -5899,7 +5934,8 @@ async function keepEndedSession(input) {
5899
5934
  await keepSession({
5900
5935
  dir: keptSessionDir(input.configPath, job.organizationId, job.workItemId),
5901
5936
  meta: { sessionId: job.sessionId, claimId: job.claimId, queue: job.queue, keptAt: input.now().toISOString() },
5902
- tar: createReadStream(tarPath)
5937
+ tar: createReadStream(tarPath),
5938
+ scrub: input.scrub
5903
5939
  });
5904
5940
  log.line(`${tag} session ${job.sessionId.slice(0, 8)} kept for the next agent job (${formatBytes(statSync(tarPath).size)})`);
5905
5941
  job.sessionKept = true;
@@ -6152,7 +6188,7 @@ async function runJudge(input) {
6152
6188
  const brief = check.judge.text;
6153
6189
  if (brief === void 0) return await fail(check, `the brief ${check.judge.brief} is not in the definitions repository`);
6154
6190
  if (tokens === void 0) return await fail(check, "the build's repository tokens are no longer held, so the branch cannot be fetched");
6155
- const credential = config.managed === true && managedClaudeKeyFor(jobDir) !== void 0 ? managedClaudeCredential() : claudeCredential(runtime.hostEnv);
6191
+ const credential = config.managed === true && managedClaudeKeyFor(jobDir) !== void 0 ? managedAgentCredential(runtime.agents) : agentCredential(runtime.hostEnv, {}, runtime.agents);
6156
6192
  if (credential === void 0) return await fail(check, "the host holds no Claude credential for the judge");
6157
6193
  const branch = job.branch;
6158
6194
  if (branch === void 0) return await fail(check, "the build pushed no branch: the claim names none");
@@ -6568,17 +6604,26 @@ function mergeScrubConfig(a, b) {
6568
6604
  patterns: [...scrubList(a?.patterns), ...scrubList(b?.patterns)]
6569
6605
  };
6570
6606
  }
6571
- function releaseScrub(config, home, jobDir) {
6607
+ function releaseScrub(config, home, jobDir, agents = defaultAgents()) {
6572
6608
  const merged = mergeScrubConfig(config.scrub, readCloudConfig(home).scrub);
6573
- const secrets = [...headerVariables(config.build?.destinations), ...CLAUDE_CREDENTIAL_VARIABLES].map((name) => process.env[name] ?? "");
6609
+ const secrets = [...headerVariables(config.build?.destinations), ...strippedVariables(agents)].map((name) => process.env[name] ?? "");
6574
6610
  const managed = config.fleet === true ? jobDir === void 0 ? [] : [...managedClaudeKeyValuesFor(jobDir), ...managedBuildSettingValuesFor(jobDir)] : [...managedClaudeKeyValues(), ...managedBuildSettingValues()];
6575
- const held3 = [currentClaudeCredential(process.env)?.value, ...removedClaudeCredentialValues(), ...managed].filter((value) => value !== void 0);
6611
+ const held3 = [...runnerAgents(agents).map((agent) => currentAgentCredential(process.env, agent.descriptor.id, agents)?.value), ...removedAgentCredentialValues(), ...managed].filter((value) => value !== void 0);
6576
6612
  return { literals: [...scrubList(merged?.literals), ...secrets, ...held3], patterns: scrubList(merged?.patterns) };
6577
6613
  }
6578
- function transcriptScrub(config, secrets, jobDir) {
6579
- const base = releaseScrub(config, homeFromEnv(), jobDir);
6614
+ function transcriptScrub(config, secrets, jobDir, agents = defaultAgents()) {
6615
+ const base = releaseScrub(config, homeFromEnv(), jobDir, agents);
6580
6616
  return { literals: [...scrubList(base.literals), ...secrets.filter((secret) => secret !== void 0 && secret !== "")], patterns: scrubList(base.patterns) };
6581
6617
  }
6618
+ function keptSessionScrub(config, job, jobDirPath) {
6619
+ return () => {
6620
+ const base = transcriptScrub(config, [job.itemKey, config.apiKey], jobDirPath);
6621
+ const literals = scrubList(base.literals);
6622
+ const escaped = literals.map((literal) => JSON.stringify(literal).slice(1, -1)).filter((form, at) => form !== literals[at]);
6623
+ installScrubContext(homeFromEnv(), { literals: [...literals, ...escaped], patterns: scrubList(base.patterns) });
6624
+ return scrubText;
6625
+ };
6626
+ }
6582
6627
  function stripUnsendableReasonChars(text2) {
6583
6628
  return text2.replace(/\u0000/g, "").replace(/\p{Cs}/gu, "");
6584
6629
  }
@@ -6953,7 +6998,7 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
6953
6998
  const sessionRuntime = (build ?? vmBuild)?.runtime;
6954
6999
  if (sessionRuntime !== void 0) {
6955
7000
  if (!valuesNotHeld) {
6956
- if (await keepEndedSession({ job, jobDirPath, runtime: sessionRuntime, configPath: config.configPath, log, tag, now })) writeJobFile(jobFilePath, job);
7001
+ if (await keepEndedSession({ job, jobDirPath, runtime: sessionRuntime, configPath: config.configPath, log, tag, now, scrub: keptSessionScrub(config, job, jobDirPath) })) writeJobFile(jobFilePath, job);
6957
7002
  } else if (job.sessionId !== void 0 && job.workItemId !== void 0 && job.sessionKept !== true) {
6958
7003
  log.error(`${tag} the session was not kept: ${VALUES_NOT_HELD} \xB7 continuing`);
6959
7004
  }
@@ -8424,7 +8469,7 @@ async function buildInBuilder(opts, deps, prepared) {
8424
8469
  toolsDockerfile({
8425
8470
  recipeImage: recipeTag,
8426
8471
  nodeImage: prepared.nodeImage,
8427
- claudeCodeVersion: prepared.claudeCodeVersion,
8472
+ claudeCodeVersion: prepared.agentVersion,
8428
8473
  buildId: opts.cli.buildId,
8429
8474
  guestHelper: true,
8430
8475
  fetched: true
@@ -8868,7 +8913,7 @@ function serveSession(transport, services, opts = {}) {
8868
8913
  });
8869
8914
  session.on("stream", (stream, headers) => {
8870
8915
  stream.on("error", noop);
8871
- const target = headers[":method"] === "POST" ? targetOfPath(headers[":path"]) : void 0;
8916
+ const target = headers[":method"] === "POST" ? targetOfPath(headers[":path"], opts.builtIns) : void 0;
8872
8917
  if (target === void 0 || open >= maxStreams) {
8873
8918
  stream.close(http2.constants.NGHTTP2_REFUSED_STREAM);
8874
8919
  return;
@@ -8930,7 +8975,7 @@ function superviseRelay(input) {
8930
8975
  });
8931
8976
  stream.stdin.on("error", noop);
8932
8977
  stream.stdout.on("error", noop);
8933
- const session = serveSession(Duplex.from({ readable: stream.stdout, writable: stream.stdin }), input.services);
8978
+ const session = serveSession(Duplex.from({ readable: stream.stdout, writable: stream.stdin }), input.services, { builtIns: input.builtIns });
8934
8979
  running = { stream, session };
8935
8980
  void stream.exited.then(() => session.close());
8936
8981
  const end = await session.ended;
@@ -9749,7 +9794,8 @@ function createContainerRuntime(opts = {}) {
9749
9794
  readKeyFiles: opts.readKeyFiles ?? readDefaultBranchFiles,
9750
9795
  clone: opts.clone ?? ((input) => cloneRepository(input.remote, input.dest)),
9751
9796
  destinationOptions: opts.destinationOptions,
9752
- claudeUpstream: opts.claudeUpstream,
9797
+ upstreams: opts.upstreams,
9798
+ agents: opts.agents,
9753
9799
  vm,
9754
9800
  cliBuild: () => cli ?? currentCliBuild(),
9755
9801
  networkHelper: opts.networkHelper ?? ((dir) => engineNetworkHelper(host, dir)),
@@ -9833,7 +9879,8 @@ function joinBuild(runtime, state, services, log) {
9833
9879
  services: services.streams,
9834
9880
  execStream: (input) => runtime.host.execStream(input),
9835
9881
  log,
9836
- onFatal: (reason) => runtime.relayFatal.set(state.buildId, reason)
9882
+ onFatal: (reason) => runtime.relayFatal.set(state.buildId, reason),
9883
+ builtIns: builtInNames(runtime.agents)
9837
9884
  })
9838
9885
  );
9839
9886
  }
@@ -9920,7 +9967,7 @@ async function provisionContainerOnce(input, allowRestore) {
9920
9967
  const tag = itemTag({ item: item.number, organizationId: input.organizationId, claimId: input.claimId });
9921
9968
  const logPath = join(jobDir, "provision.log");
9922
9969
  const fail = (reason) => ({ ok: false, reason });
9923
- if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
9970
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir, runtime.agents)) return fail(AGENT_CREDENTIAL_MISSING);
9924
9971
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
9925
9972
  const primary = primaryOf(repositories);
9926
9973
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -10012,6 +10059,7 @@ async function provisionContainerOnce(input, allowRestore) {
10012
10059
  repository,
10013
10060
  repositories,
10014
10061
  hostEnv: runtime.hostEnv,
10062
+ agents: runtime.agents,
10015
10063
  containerEnv: report.apply.containerEnv,
10016
10064
  builtIns: true
10017
10065
  };
@@ -10118,7 +10166,7 @@ async function provisionContainerOnce(input, allowRestore) {
10118
10166
  const notReady = await startNetworkHelper(runtime, { name: state.network, buildId, runnerId, image: report.imageId, limits: limits2, ipv6: runtime.ipv6 }, logPath);
10119
10167
  if (notReady !== void 0) return bail(notReady);
10120
10168
  if (input.aborted()) return bail("", true);
10121
- const started = await host.run(containerRunArgs({ ...runInput, network: state.network, home: state.home }), { logPath });
10169
+ const started = await host.run(containerRunArgs({ ...runInput, network: state.network, home: state.home }, runtime.agents), { logPath });
10122
10170
  if (started.status !== 0) return dockerFailed("starting the build's container", started);
10123
10171
  joinBuild(runtime, state, services, (line2) => log.line(`${tag} ${line2}`));
10124
10172
  if (input.aborted()) return bail("", true);
@@ -10137,7 +10185,7 @@ async function provisionContainerOnce(input, allowRestore) {
10137
10185
  const changed = userIdChangedReason(plan.restore?.record.agentUid, agentUid);
10138
10186
  if (changed !== void 0) return giveUpState(changed);
10139
10187
  const tools = await host.exec({ container: name, user: ADDED_USER, env: NO_ENV, argv: ["cat", "/opt/outerlayer/tools.json"] });
10140
- const agentVersion = agentVersionOf2(tools.status === 0 ? tools.stdout : "");
10188
+ const agentVersion = agentVersionOf(tools.status === 0 ? tools.stdout : "", runtime.agents);
10141
10189
  environment.agentVersion = agentVersion;
10142
10190
  const program = await host.exec({ container: name, user: ADDED_USER, env: NO_ENV, argv: [...HASH_ARGV] });
10143
10191
  const hashed = program.status === 0 ? parseProgramHash(program.stdout) : void 0;
@@ -10242,14 +10290,6 @@ async function copyBuildHome(runtime, runInput, home, logPath) {
10242
10290
  if (copied.status === 0) return void 0;
10243
10291
  return `copying ${home} into the build's home failed (exit ${copied.status})${said(copied.stderr)}`;
10244
10292
  }
10245
- function agentVersionOf2(toolsJson) {
10246
- try {
10247
- const version = JSON.parse(toolsJson).claudeCodeVersion;
10248
- if (typeof version === "string" && version !== "") return version;
10249
- } catch {
10250
- }
10251
- return CLAUDE_CODE_VERSION;
10252
- }
10253
10293
  function shellQuote(word) {
10254
10294
  return /^[A-Za-z0-9_@%+=:,./-]+$/.test(word) ? word : `'${word.replace(/'/g, `'\\''`)}'`;
10255
10295
  }
@@ -10263,6 +10303,7 @@ function containerCommandExec(input) {
10263
10303
  repository: state.repository,
10264
10304
  repositories: input.job.repositories,
10265
10305
  hostEnv: input.runtime.hostEnv,
10306
+ agents: input.runtime.agents,
10266
10307
  containerEnv: state.containerEnv ?? {},
10267
10308
  unpinnedRuntimes: state.unpinnedRuntimes,
10268
10309
  missingSetupScripts: state.missingSetupScripts,
@@ -10290,6 +10331,7 @@ function containerSenderCommand(input) {
10290
10331
  repository: state.repository,
10291
10332
  repositories: input.job.repositories,
10292
10333
  hostEnv: input.runtime.hostEnv,
10334
+ agents: input.runtime.agents,
10293
10335
  containerEnv: state.containerEnv ?? {},
10294
10336
  unpinnedRuntimes: state.unpinnedRuntimes,
10295
10337
  missingSetupScripts: state.missingSetupScripts,
@@ -10364,7 +10406,7 @@ async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, bui
10364
10406
  ...lease === void 0 ? {} : { lease },
10365
10407
  ...inherit === void 0 ? {} : { inherit },
10366
10408
  ...routeLog === void 0 ? {} : { log: routeLog },
10367
- ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream, claudeApiKey: managedClaudeKeyFor(jobDir) } } : {},
10409
+ ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, upstreams: runtime.upstreams, claudeApiKey: managedClaudeKeyFor(jobDir), agents: runtime.agents } } : {},
10368
10410
  hostEnv: runtime.hostEnv,
10369
10411
  destinationOptions: runtime.destinationOptions
10370
10412
  });
@@ -10431,6 +10473,7 @@ async function runCliInContainer(input, argv, logName) {
10431
10473
  repository: state.repository,
10432
10474
  repositories: job.repositories,
10433
10475
  hostEnv: runtime.hostEnv,
10476
+ agents: runtime.agents,
10434
10477
  containerEnv: state.containerEnv ?? {},
10435
10478
  unpinnedRuntimes: state.unpinnedRuntimes,
10436
10479
  missingSetupScripts: state.missingSetupScripts,
@@ -10712,7 +10755,7 @@ async function startCheckContainer(input) {
10712
10755
  const notReady = await startNetworkHelper(runtime, { name: state.network, buildId, runnerId, image: built.imageId, limits: limits2, ipv6: runtime.ipv6 }, logPath);
10713
10756
  if (notReady !== void 0) return fail(notReady);
10714
10757
  }
10715
- const started = await host.run(containerRunArgs({ ...runInput, network: state.network, home: state.home }), { logPath });
10758
+ const started = await host.run(containerRunArgs({ ...runInput, network: state.network, home: state.home }, runtime.agents), { logPath });
10716
10759
  if (started.status !== 0) return dockerFailed("starting the check environment's container", started);
10717
10760
  if (transport === "exec") joinBuild(runtime, state, services, (line2) => log.line(`${tag} ${line2}`));
10718
10761
  if (!await waitForRelay(runtime, state)) return fail("the relay in the check environment's container did not start");
@@ -11239,4 +11282,4 @@ async function runHostChecks(input) {
11239
11282
  }
11240
11283
  }
11241
11284
 
11242
- export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MAX_CHECK_ITEMS_BYTES, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, appendCommandLog, attemptNote, checksIn, claimPermissionProblem, claudeCredentialCheck, commandItems, commandLogOffset, containerCommandExec, createContainerRuntime, createHousekeepingDocker, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, describeHookEnd, describeMachineDocker, detectMachine, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedClaudeKey, filesAreCopied, finishJob, firstLine3 as firstLine, foldSample, formerSkillProblem, formerSkillQueues, gitRemoteFor, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedClaudeKey, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inTeardown, isContainerTracked, isGroupAlive, isIdle, isJudgeCheck, isMicroVmTracked, isPlaceholderCommand, isReadable, isTimedOut, isTracked, isUnfinished, itemScope, itemTag, jobEnv, judgeProbe, keepGhConfigCurrent, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, measureDisk, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingPermissionFix, missingPermissionOf, needsBuildSkill, needsClaudeCredential, needsRenew, outcomeFromExitCode, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionProcess, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, recoverLostJobs, releaseLease, removeOldestUntil, renewLease, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, retryFailedReleases, runCommand, runHook, runHostChecks, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, stripTerminalControls, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, testProofIn, timeoutAfter, unfinishedJobs, usableCpus, vmAlive, withTunnelLog, workdirProblem, writeGuestGhConfig, writeRunnerInit };
11285
+ export { ADOPTED_FETCH_RETRY_WINDOW_MS, ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, GUEST_USAGE_INTERVAL_MS, HELPER_ENV, KIND_LABEL, LEASE_SECONDS, MAX_CHECK_ITEMS_BYTES, MICROVM_COMMAND_DIR, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, RENEW_INTERVAL_SECONDS, RunnerInitError, agentCredentialCheck, appendCommandLog, attemptNote, checksIn, claimPermissionProblem, commandItems, commandLogOffset, containerCommandExec, createContainerRuntime, createHousekeepingDocker, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deliverCommitHooks, deliverContainerHooks, deliverExecMaven, deliverJobFiles, describeHookEnd, describeMachineDocker, detectMachine, ensureFirecrackerAndJailer, ensureNetworkReady, ensureTunnel, execArgv, execCommandLine, fetchManagedBuildSettings, fetchManagedClaudeKey, filesAreCopied, finishJob, firstLine3 as firstLine, foldSample, formerSkillProblem, formerSkillQueues, gitRemoteFor, helperFirecrackerNote, helperSocketPath, holdManagedBuildSettings, holdManagedClaudeKey, hookLimitsFor, hostCommandEnvironment, hostEnvironment, housekeepingDockerIfReachable, inTeardown, isContainerTracked, isGroupAlive, isIdle, isJudgeCheck, isMicroVmTracked, isPlaceholderCommand, isReadable, isTimedOut, isTracked, isUnfinished, itemScope, itemTag, jobEnv, judgeProbe, keepGhConfigCurrent, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listAdoptableJobs, listTrackedJobs, listUnreadableJobs, listenOnBroker, makeRecorder, managedBuildSettingsFor, measureDisk, microVmArchSupported, microVmAssetsPinned, microVmCommandLine, microVmOomKills, missingPermissionFix, missingPermissionOf, needsAgentCredential, needsBuildSkill, needsRenew, outcomeFromExitCode, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareResume, prepareRunnerInit, probeCommand, probeHelper, probeMicroVmCommand, provisionContainer, provisionEnvironment, provisionMicroVm, provisionProcess, reachDockerStep, readConfigObject, readCpuUsec, readDefinitions, readProvisionOut, readRecords, recoverLostJobs, releaseLease, removeOldestUntil, renewLease, resolveHostBuild, restartSender, restoreSessionIntoContainer, restoreSessionIntoMicroVm, retryFailedReleases, runCommand, runHook, runHostChecks, runHousekeeping, runRunnerInit, runWithSpawn, sampleGuest, savedStatesDir, scrubReason, serveLease, setStage, setUpRunnerCgroup, shellQuote, startHostServices, startMicroVmCommand, startSender, startServicesFor, stopOrphanedMicroVms, stoppedHelperReason, stripTerminalControls, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, testProofIn, timeoutAfter, unfinishedJobs, usableCpus, vmAlive, withTunnelLog, workdirProblem, writeGuestGhConfig, writeRunnerInit };