@outerlayer/cli 0.36.0-next.20261101131017 → 0.36.0-next.20261102124202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-setup-AOB76EDJ.js +37 -0
- package/dist/{artifact-link-cmd-W7LRR76D.js → artifact-link-cmd-ZCMQIT5Y.js} +2 -2
- package/dist/bridge-DFG2GTXQ.js +13 -0
- package/dist/build-THAD3B4Q.js +21 -0
- package/dist/build-disk-HO2VPIBJ.js +18 -0
- package/dist/build-info.json +1 -1
- package/dist/builder-AXJNIF4S.js +17 -0
- package/dist/caller-GOY2X6QT.js +20 -0
- package/dist/{check-G4TVQKN3.js → check-SF2OVZXB.js} +73 -71
- package/dist/{chunk-KB5B6ZT5.js → chunk-3FSKTGM6.js} +20 -20
- package/dist/{chunk-CONA2WNE.js → chunk-4CTVN3C5.js} +18 -11
- package/dist/{chunk-2QW2PLWT.js → chunk-4TNUQLXH.js} +8 -8
- package/dist/{chunk-LGV5N5DG.js → chunk-564Q2STF.js} +1 -1
- package/dist/{chunk-2ANBJ7DB.js → chunk-5FIOUQGC.js} +8 -8
- package/dist/{chunk-4W7CPTKY.js → chunk-5FND4PIU.js} +3 -3
- package/dist/{chunk-SQ6HDN7A.js → chunk-5GHJFETA.js} +1 -1
- package/dist/{chunk-4DJZSNVT.js → chunk-6JJITHBI.js} +1 -1
- package/dist/{chunk-6CYNPWZT.js → chunk-6LO62EQ5.js} +151 -108
- package/dist/{chunk-RIHB3HA2.js → chunk-772ILTCK.js} +3 -3
- package/dist/{chunk-CIUD3436.js → chunk-A5Y2HBVU.js} +1 -1
- package/dist/{chunk-F3ZMVUAS.js → chunk-AYLYAOHH.js} +5 -5
- package/dist/{chunk-DZDTSDHQ.js → chunk-C3JWWPLC.js} +10 -11
- package/dist/{chunk-JFMSFHER.js → chunk-CKPQOQFC.js} +644 -74
- package/dist/{chunk-ALEUIS35.js → chunk-CVGQ3BNF.js} +1 -1
- package/dist/{chunk-GDMAN42R.js → chunk-EBIYRRJW.js} +5 -5
- package/dist/{chunk-UIKUH2UQ.js → chunk-ESSJPSJ2.js} +2 -2
- package/dist/{chunk-A67A5SWG.js → chunk-EUDG754F.js} +2 -2
- package/dist/{chunk-55PYF6S2.js → chunk-FIO6PIZ6.js} +3 -3
- package/dist/{chunk-WT7J2627.js → chunk-GD6KIHOS.js} +1 -1
- package/dist/{chunk-SRENPED2.js → chunk-GDZTL6BI.js} +42 -33
- package/dist/{chunk-AF6DQJ5W.js → chunk-GSXGA6KF.js} +1 -1
- package/dist/{chunk-T3AJOPUR.js → chunk-GZ75FRLB.js} +4 -5
- package/dist/chunk-H2FFONRY.js +136 -0
- package/dist/{chunk-IM2DECLP.js → chunk-HIN4BMRW.js} +3 -3
- package/dist/{chunk-OLENS2DD.js → chunk-I626B72C.js} +29 -26
- package/dist/{chunk-YCUUZGFF.js → chunk-I6FRCBMU.js} +26 -21
- package/dist/{chunk-PN6TNCQI.js → chunk-J7TCTARR.js} +11 -12
- package/dist/chunk-J7Y3PCO2.js +653 -0
- package/dist/{chunk-YQHEJ5SV.js → chunk-JVCQZDQ6.js} +3 -3
- package/dist/{chunk-5DYL6FJA.js → chunk-JXXHLQQR.js} +3 -3
- package/dist/{chunk-VI6Z4EJZ.js → chunk-K3X3L5YW.js} +4 -4
- package/dist/{chunk-MKSZHT6S.js → chunk-KN4VIK53.js} +1 -1
- package/dist/{chunk-3LCXSD26.js → chunk-L2BA2HXM.js} +1 -1
- package/dist/chunk-L3JXQDVH.js +78 -0
- package/dist/{chunk-3ONYQMGD.js → chunk-LCOQN6NR.js} +3 -3
- package/dist/{chunk-6KHQGLNT.js → chunk-LSXHTBAM.js} +5 -5
- package/dist/{chunk-RGH5GYU2.js → chunk-LVXR37OG.js} +47 -38
- package/dist/{chunk-HGGR7Y3V.js → chunk-LYFLUNWK.js} +12 -12
- package/dist/{chunk-GANAOCHR.js → chunk-M2NIHHQI.js} +24 -374
- package/dist/chunk-NC3QAHOS.js +26 -0
- package/dist/{chunk-UFRRRF64.js → chunk-NTMRMBLM.js} +10 -5
- package/dist/{chunk-RGU6LHPI.js → chunk-NWBB2SQ4.js} +38 -35
- package/dist/{chunk-A7D5BMII.js → chunk-OYKAOHX5.js} +5 -5
- package/dist/{chunk-46YRS7QS.js → chunk-OZOATEK3.js} +4 -4
- package/dist/{chunk-3PQTOKML.js → chunk-P6PHY33P.js} +1 -1
- package/dist/{chunk-GQ7VVBUA.js → chunk-PKO5IDW4.js} +7 -7
- package/dist/{chunk-7J7HRYZ3.js → chunk-PQDFW422.js} +1 -1
- package/dist/{chunk-EZRAR5YG.js → chunk-PT34C6SU.js} +1 -1
- package/dist/{chunk-K66FIV2S.js → chunk-PTPF36Q7.js} +3 -3
- package/dist/{chunk-7Y5VW4JG.js → chunk-Q42K6XZ6.js} +1 -1
- package/dist/{chunk-VIJWXQMT.js → chunk-QJDX6VJS.js} +7 -7
- package/dist/{chunk-W46566FP.js → chunk-RK4JQRVT.js} +9 -9
- package/dist/{chunk-U553JKMO.js → chunk-RPZIHELI.js} +5 -5
- package/dist/{chunk-CIEX2ZKQ.js → chunk-RSRZDF3K.js} +6 -6
- package/dist/{chunk-46OBCATR.js → chunk-T5Z22NA6.js} +1 -1
- package/dist/{chunk-5H57X7YC.js → chunk-TPMLB3VZ.js} +1 -1
- package/dist/chunk-TWYHSMHM.js +67 -0
- package/dist/{chunk-6GA5BJTH.js → chunk-TYCZVJTB.js} +54 -31
- package/dist/{chunk-4SFHEARD.js → chunk-VRQM4A64.js} +6 -3
- package/dist/{chunk-LRCGXRQI.js → chunk-WDQPBAFV.js} +44 -19
- package/dist/{chunk-UZGQT6OF.js → chunk-WLMAGMTU.js} +5 -3
- package/dist/{chunk-KCUX5I5W.js → chunk-WNYH42PF.js} +6 -6
- package/dist/{chunk-C4YULCXX.js → chunk-WQB3XOEP.js} +28 -31
- package/dist/{chunk-VUG4IZ7H.js → chunk-WUKLQWGY.js} +1 -1
- package/dist/{chunk-MDFOS4OM.js → chunk-XABJMU5A.js} +4 -4
- package/dist/{chunk-MMXPNEEQ.js → chunk-XAOIHYPS.js} +29 -24
- package/dist/{chunk-WAZJPDR2.js → chunk-XE3DIJJT.js} +1 -1
- package/dist/{chunk-3SQZ5LIK.js → chunk-XHFSBSIA.js} +4 -4
- package/dist/{chunk-GDIVOYDA.js → chunk-XLOM2BNL.js} +3 -4
- package/dist/{claude-launcher-YV3TDXBU.js → claude-launcher-LXZPTDNC.js} +23 -18
- package/dist/{cli-EMQEIYSR.js → cli-QFUT3UQS.js} +145 -146
- package/dist/{cli-update-notice-T3CXRWNB.js → cli-update-notice-AWYJ4A7R.js} +2 -2
- package/dist/{command-GKVKI74I.js → command-45RZT4CK.js} +59 -60
- package/dist/{config-4HXUXX3M.js → config-WYQPXLOP.js} +13 -11
- package/dist/connect-cmd-LUCQ7FSV.js +26 -0
- package/dist/{container-start-OMF3ZUIB.js → container-start-T776VI3M.js} +59 -58
- package/dist/{context-cleanup-TPHCVVFV.js → context-cleanup-QE2MIO2Q.js} +5 -3
- package/dist/{context-show-cmd-MKQAAR7R.js → context-show-cmd-7QEHUOEL.js} +17 -17
- package/dist/{control-plane-launch-UWFQWMWB.js → control-plane-launch-THUH6YU5.js} +19 -19
- package/dist/{demo-record-cmd-Y57UWBCX.js → demo-record-cmd-SBERRQNW.js} +8 -5
- package/dist/{demo-voice-cmd-H4PCO2PT.js → demo-voice-cmd-VM3FITZU.js} +22 -24
- package/dist/{dist-Y3WSK7OZ.js → dist-6KGTCWKR.js} +2 -2
- package/dist/docker-MQNLK4OO.js +17 -0
- package/dist/{doctor-FEBZ3DZB.js → doctor-NQOSPJGS.js} +75 -72
- package/dist/emit-artifact-cmd-6E365VBQ.js +41 -0
- package/dist/emit-cmd-ZPFCPVSR.js +16 -0
- package/dist/emit-criteria-cmd-HWQOYZZ4.js +32 -0
- package/dist/{emit-demo-cmd-VKGN74NW.js → emit-demo-cmd-PMQGNNVX.js} +22 -24
- package/dist/{emit-finding-cmd-DNFJEYQS.js → emit-finding-cmd-MYWQN5WW.js} +17 -18
- package/dist/{emit-result-cmd-OR5WTW4P.js → emit-result-cmd-GXK3KMAP.js} +20 -21
- package/dist/{emit-step-cmd-AAEBYW3L.js → emit-step-cmd-ZV2XTUVT.js} +17 -18
- package/dist/exec-client-P7RFRUCK.js +14 -0
- package/dist/find-unit-63SXQ7IM.js +21 -0
- package/dist/{findings-cmd-LTM62M3K.js → findings-cmd-OGMBVVSM.js} +17 -18
- package/dist/fleet-readiness-4RBKLXBQ.js +27 -0
- package/dist/governing-source-XJMXFSAR.js +38 -0
- package/dist/guest-init-XZHRPIMG.js +16 -0
- package/dist/{hook-fast-3HPWMSFB.js → hook-fast-ZOWGWCPO.js} +5 -5
- package/dist/host-checks-WHW24PJR.js +76 -0
- package/dist/host-key-MWLXB5U5.js +14 -0
- package/dist/{image-tag-WBD57QBN.js → image-tag-E4JK2APF.js} +9 -4
- package/dist/index.js +4 -4
- package/dist/init-EZIAHBMH.js +76 -0
- package/dist/{init-O5H4TWA7.js → init-LO6U7YTW.js} +56 -55
- package/dist/{init-cmd-HWAXEEOD.js → init-cmd-2JANO5EN.js} +27 -28
- package/dist/{init-update-3W2TOJQV.js → init-update-D6PRTGNE.js} +55 -48
- package/dist/install-cmd-SJMBNQEH.js +17 -0
- package/dist/layout-AQHIMJMO.js +11 -0
- package/dist/{login-browser-ODTJEGDN.js → login-browser-QH4KYG3F.js} +2 -2
- package/dist/{logs-FEITSC2V.js → logs-NE55HOET.js} +8 -3
- package/dist/loop-2E34CGCX.js +87 -0
- package/dist/machine-6ALGG4IO.js +76 -0
- package/dist/{machine-skills-VRUJVBQV.js → machine-skills-KK2HXYMR.js} +3 -4
- package/dist/{mcp-install-cmd-23ZY4IBK.js → mcp-install-cmd-2QAS3AQZ.js} +5 -1
- package/dist/{mcp-serve-cmd-ZINYSLY6.js → mcp-serve-cmd-U6USKHYR.js} +9 -7
- package/dist/{paths-XEYE7OZ2.js → paths-O7LCWY33.js} +8 -3
- package/dist/pending-YU2GE2UV.js +14 -0
- package/dist/pidfile-5GDCQ5HA.js +15 -0
- package/dist/record-NETSDAO6.js +14 -0
- package/dist/{relay-IEYNSKAZ.js → relay-VZ733BVJ.js} +6 -1
- package/dist/{relay-protocol-5LSWUJCW.js → relay-protocol-24GEUGCO.js} +6 -1
- package/dist/runner-env-KHCONH2R.js +21 -0
- package/dist/runner-identity-PSCZBILD.js +17 -0
- package/dist/{runner-key-HUOW7X7B.js → runner-key-VM2LYVRK.js} +48 -50
- package/dist/{session-sender-32UAV25N.js → session-sender-P2RHDM6U.js} +21 -22
- package/dist/{spec-cmd-TPRHZ3EV.js → spec-cmd-LGKP6MT7.js} +18 -19
- package/dist/{starter-pack-7QNUT74O.js → starter-pack-SMK6UPRL.js} +6 -7
- package/dist/state-RJR4PMMX.js +14 -0
- package/dist/{status-HDJ2V5UD.js → status-HEHCNIDS.js} +48 -50
- package/dist/{sync-cmd-AHXCXMVP.js → sync-cmd-HKN45HXL.js} +20 -21
- package/dist/update-steps-7E4RD47J.js +77 -0
- package/dist/{watch-4EDI4CTS.js → watch-RGZCUCR3.js} +20 -21
- package/dist/{work-claim-cmd-GFRZBX2V.js → work-claim-cmd-6DSPGCZE.js} +24 -26
- package/dist/{work-cmd-FLKJQWGQ.js → work-cmd-GPLYLWY7.js} +17 -18
- package/dist/work-comment-cmd-V5WM7LAW.js +35 -0
- package/dist/{work-demo-cmd-FDPDTXG6.js → work-demo-cmd-SWWI6AGD.js} +17 -18
- package/dist/{work-logs-cmd-PSB44DT5.js → work-logs-cmd-CTFBOPCI.js} +17 -18
- package/dist/{work-open-pr-cmd-QJW5PNT2.js → work-open-pr-cmd-HX2U3YBR.js} +18 -19
- package/dist/{work-pr-cmd-HMGBUHGL.js → work-pr-cmd-EI2R4FQG.js} +17 -18
- package/dist/{work-proofs-cmd-3GPGH4RL.js → work-proofs-cmd-QXNPHLYC.js} +19 -20
- package/dist/{work-proofs-record-AC4GYMQA.js → work-proofs-record-72OKWEES.js} +26 -28
- package/dist/{work-stop-cmd-YO7SBPNF.js → work-stop-cmd-7M7ZYUN2.js} +17 -18
- package/package.json +2 -1
- package/dist/agent-setup-UYTS2PHZ.js +0 -33
- package/dist/bridge-XM4QLKIX.js +0 -8
- package/dist/build-IENNKWWC.js +0 -18
- package/dist/build-disk-M33Q6L22.js +0 -15
- package/dist/builder-YNMSYR75.js +0 -14
- package/dist/caller-2GU5V52U.js +0 -18
- package/dist/chunk-3DMCCCVM.js +0 -74
- package/dist/chunk-7O7LJWQO.js +0 -144
- package/dist/chunk-FGF52V4V.js +0 -137
- package/dist/chunk-HCVLP7XA.js +0 -53
- package/dist/chunk-MESOOLF4.js +0 -45
- package/dist/chunk-OHQMGLJP.js +0 -113
- package/dist/chunk-OUPQTA7N.js +0 -145
- package/dist/connect-cmd-GLB2X7YA.js +0 -27
- package/dist/docker-AFJABU7U.js +0 -14
- package/dist/emit-artifact-cmd-DGFH4MUK.js +0 -42
- package/dist/emit-cmd-HNXRGC5Z.js +0 -17
- package/dist/emit-criteria-cmd-B23VYUF6.js +0 -33
- package/dist/exec-client-FGGPQSYQ.js +0 -9
- package/dist/find-unit-4XKMNIE7.js +0 -19
- package/dist/fleet-readiness-FAKMWCJV.js +0 -28
- package/dist/governing-source-75MBT2IE.js +0 -39
- package/dist/guest-init-WPUS45IN.js +0 -11
- package/dist/host-checks-PUI32LIA.js +0 -78
- package/dist/host-key-O4DFMOSV.js +0 -9
- package/dist/init-Y672J4BW.js +0 -78
- package/dist/install-cmd-JKPXIOEY.js +0 -12
- package/dist/layout-TLUOMM6F.js +0 -11
- package/dist/loop-QJGPNIT4.js +0 -89
- package/dist/machine-YKQSW22W.js +0 -78
- package/dist/pending-D2NNV54J.js +0 -9
- package/dist/pidfile-FLFVRKVW.js +0 -10
- package/dist/record-JMZOXD4R.js +0 -9
- package/dist/runner-env-FK3SUT3Q.js +0 -19
- package/dist/runner-identity-WYAGV6UQ.js +0 -14
- package/dist/state-UWIM42JH.js +0 -9
- package/dist/update-steps-F37GQWLJ.js +0 -79
- package/dist/work-comment-cmd-3HUIIEQD.js +0 -36
- 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-
|
|
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-XLOM2BNL.js';
|
|
4
4
|
import { zodProblem } from './chunk-I3LTIAOR.js';
|
|
5
5
|
import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
|
|
6
|
-
import { upgradedStarterText } from './chunk-
|
|
7
|
-
import { senderPidfile } from './chunk-
|
|
8
|
-
import { installScrubContext } from './chunk-
|
|
6
|
+
import { upgradedStarterText } from './chunk-RPZIHELI.js';
|
|
7
|
+
import { senderPidfile } from './chunk-LCOQN6NR.js';
|
|
8
|
+
import { installScrubContext } from './chunk-4TNUQLXH.js';
|
|
9
9
|
import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
10
|
-
import { runnerImageVersion } from './chunk-
|
|
11
|
-
import { hasStoredCredential, AGENT_COMMANDS,
|
|
10
|
+
import { runnerImageVersion } from './chunk-CVGQ3BNF.js';
|
|
11
|
+
import { hasStoredCredential, AGENT_COMMANDS, storeAgentCredential, credentialFromStdin, isAgentName } from './chunk-L3JXQDVH.js';
|
|
12
12
|
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-
|
|
14
|
-
import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-
|
|
13
|
+
import { readDefaultBranchFiles, readDefaultBranchHead, cloneRepository, buildRepositoryImage, fetchCommit, readBranchHead, diffBetween, prepareImageBuild, KEY_PREFIX, TAG_HOST, SHARED_OWNER, SHARED_NAME, universalBase, metadataFromLabels, writeRecord } from './chunk-LYFLUNWK.js';
|
|
14
|
+
import { FETCHED_DIR, toolsDockerfile, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_HEADLESS_SHELL, FETCHED_PLAYWRIGHT_FFMPEG, FETCHED_VOICE_DIR } from './chunk-3FSKTGM6.js';
|
|
15
15
|
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
16
|
-
import { vmExecArgs, runExec, execCapture, waitForAgent } from './chunk-
|
|
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-
|
|
18
|
-
import { HELPER_PATH, HELPER_RECORD, DOCKERD_LOG } from './chunk-
|
|
16
|
+
import { vmExecArgs, runExec, execCapture, waitForAgent } from './chunk-T5Z22NA6.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-5FIOUQGC.js';
|
|
18
|
+
import { HELPER_PATH, HELPER_RECORD, DOCKERD_LOG } from './chunk-FIO6PIZ6.js';
|
|
19
19
|
import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
|
|
20
|
-
import { socketPathProblem, vsockLinks, linkVsockSockets, GUEST_CID, LEASE_LINK } from './chunk-
|
|
21
|
-
import { writeDockerClientConfig } from './chunk-
|
|
22
|
-
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-
|
|
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-
|
|
24
|
-
import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-
|
|
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-
|
|
26
|
-
import { universalImagePending, RecipeError, writeSanitizedRecipe, classifyProperties, DOCKER_FEATURE } from './chunk-
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { sanitizeTerminal, planArtifactUpload } from './chunk-3PQTOKML.js';
|
|
20
|
+
import { socketPathProblem, vsockLinks, linkVsockSockets, GUEST_CID, LEASE_LINK } from './chunk-WLMAGMTU.js';
|
|
21
|
+
import { writeDockerClientConfig } from './chunk-KN4VIK53.js';
|
|
22
|
+
import { claimCalls, spoolHomeFor, itemCalls, claimItem, leftByRunnerKey } from './chunk-EUDG754F.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-NTMRMBLM.js';
|
|
24
|
+
import { formatBytes, volumeBytes, allocatedBytes, DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, freeBytes } from './chunk-ESSJPSJ2.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-C3JWWPLC.js';
|
|
26
|
+
import { universalImagePending, RecipeError, writeSanitizedRecipe, classifyProperties, DOCKER_FEATURE } from './chunk-A5Y2HBVU.js';
|
|
27
|
+
import { postJson, WorkCommandError, getJson, isSignatureRefusal } from './chunk-QJDX6VJS.js';
|
|
28
|
+
import { sanitizeTerminal, planArtifactUpload } from './chunk-P6PHY33P.js';
|
|
30
29
|
import { readCloudConfig } from './chunk-HWVMRETT.js';
|
|
31
|
-
import { signerFor } from './chunk-
|
|
32
|
-
import { sharedSkillNames, skillConflictMessage } from './chunk-
|
|
33
|
-
import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
30
|
+
import { signerFor } from './chunk-6JJITHBI.js';
|
|
31
|
+
import { sharedSkillNames, skillConflictMessage } from './chunk-TWYHSMHM.js';
|
|
32
|
+
import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-NC3QAHOS.js';
|
|
33
|
+
import { scrubText, MIN_SCRUBBED_LITERAL, setCustomScrubbers, setLocalIdentity, setRepoRoot, forkFor, parseTranscript, scrubDeep } from './chunk-5GHJFETA.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-GD6KIHOS.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-M2NIHHQI.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-J7Y3PCO2.js';
|
|
37
|
+
import { defaultAgents, parsePolicy, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, resolvePackRoot, orderSessions, extractFacts, sessionsToTimeline } from './chunk-CKPQOQFC.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-JFMSFHER.js';
|
|
39
|
-
import { CheckItemsSchema, downconvertSession } from './chunk-VUG4IZ7H.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,
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
1720
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
1890
|
+
function needsAgentCredential(hooks) {
|
|
1865
1891
|
return builtinKind(hooks.provision) !== "own";
|
|
1866
1892
|
}
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
const
|
|
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
|
|
1877
|
-
fix: `${
|
|
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
|
|
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 =
|
|
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:
|
|
1888
|
-
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 =
|
|
5484
|
-
for (const name of
|
|
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,
|
|
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) => !
|
|
5507
|
-
builtIns: Object.fromEntries((build.destinations ?? []).filter((d) =>
|
|
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 (
|
|
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 ?
|
|
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), ...
|
|
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 = [
|
|
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.
|
|
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
|
-
|
|
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 =
|
|
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,
|
|
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,
|
|
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 };
|