@outerlayer/cli 0.34.0-next.20261027193835 → 0.34.0-next.20261028010245
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-THDNZ5ME.js → agent-setup-6FPE6EYN.js} +6 -6
- package/dist/{bridge-MLB57JP6.js → bridge-JGIHPGMY.js} +2 -2
- package/dist/{build-25GDCEZ7.js → build-AAQ4PVP2.js} +9 -9
- package/dist/{build-disk-NFMQCZM3.js → build-disk-L7JRQA22.js} +7 -7
- package/dist/build-info.json +1 -1
- package/dist/{builder-OWDGC3VQ.js → builder-LMLAVVVF.js} +6 -6
- package/dist/{check-IFHLERRX.js → check-C7UKLYZQ.js} +38 -38
- package/dist/{chunk-JO4SAEHH.js → chunk-23XAA7YD.js} +2 -2
- package/dist/{chunk-7SJNVGVC.js → chunk-32FAPJFD.js} +5 -5
- package/dist/{chunk-4HA4S3U2.js → chunk-3E7QAXUW.js} +152 -7
- package/dist/{chunk-3FTIUB7I.js → chunk-3X6OSXSB.js} +1 -1
- package/dist/{chunk-3RRYEZAC.js → chunk-3XOLOV5A.js} +3 -3
- package/dist/{chunk-PMIW6OGQ.js → chunk-4A5OJOCR.js} +9 -9
- package/dist/{chunk-NO6E72RM.js → chunk-4J5GRWAY.js} +1 -1
- package/dist/{chunk-4QQJTJUN.js → chunk-57WFXHCB.js} +1 -1
- package/dist/{chunk-36M4KVBT.js → chunk-5IUC2B6J.js} +2 -2
- package/dist/{chunk-7TLGRE5F.js → chunk-5LUN7TTR.js} +2 -2
- package/dist/{chunk-OP2L7OXA.js → chunk-6LS62EO4.js} +3 -3
- package/dist/{chunk-FVVHQIZR.js → chunk-6OLXDSQ6.js} +1 -1
- package/dist/{chunk-AV5T7HV3.js → chunk-6Q7O4MRI.js} +1 -1
- package/dist/{chunk-UZIAZXXO.js → chunk-77D5ENBA.js} +1 -1
- package/dist/{chunk-FLHBUQ2W.js → chunk-AHWMY3MS.js} +155 -10
- package/dist/{chunk-3VJYDWFV.js → chunk-AJTGTSNA.js} +1 -1
- package/dist/{chunk-5FHBVV25.js → chunk-BQ4C47K2.js} +7 -7
- package/dist/{chunk-EYJRVHBN.js → chunk-BTDBDTUY.js} +2 -2
- package/dist/{chunk-X7M73LKT.js → chunk-CM4J53WZ.js} +1 -1
- package/dist/{chunk-WX2HW2G2.js → chunk-D3CT6XQ4.js} +10 -3
- package/dist/{chunk-HJCNWEQK.js → chunk-D6SH7DWA.js} +2 -2
- package/dist/{chunk-LYX2RRSF.js → chunk-EGJY6MBC.js} +2 -2
- package/dist/{chunk-T6ALNN3H.js → chunk-F3BGTGQC.js} +1 -1
- package/dist/{chunk-BS3OYFAD.js → chunk-G4SOMWXL.js} +1 -1
- package/dist/{chunk-BS4CZMT6.js → chunk-GET5HKLM.js} +1 -1
- package/dist/{chunk-6IMQXBTZ.js → chunk-GJYGOFF3.js} +5 -5
- package/dist/{chunk-Y4WJ4BLX.js → chunk-GMEXR6PY.js} +6 -6
- package/dist/{chunk-JWMJMQRF.js → chunk-GXMMILQ4.js} +4 -4
- package/dist/{chunk-S5U6RKQX.js → chunk-HFMK2R7O.js} +99 -179
- package/dist/{chunk-WR2GRWK3.js → chunk-I4YOWQH7.js} +1 -1
- package/dist/{chunk-QRIE4JZE.js → chunk-JXY66VYX.js} +2 -2
- package/dist/{chunk-CMMEJJTL.js → chunk-KTVZ7TZY.js} +2 -2
- package/dist/{chunk-GMKDAF37.js → chunk-L2OARQKP.js} +17 -98
- package/dist/{chunk-CFJOONWM.js → chunk-LBKCYEJT.js} +1 -1
- package/dist/{chunk-OHTMTMFX.js → chunk-NBETYM32.js} +4 -4
- package/dist/{chunk-MXAYUZJF.js → chunk-NCKH3KCM.js} +5 -5
- package/dist/{chunk-RCAMBC3H.js → chunk-NOEJGR4X.js} +2 -2
- package/dist/{chunk-62URQYCB.js → chunk-PAGB3DCI.js} +1 -1
- package/dist/{chunk-Y7MF32DM.js → chunk-PBI4CM4M.js} +67 -60
- package/dist/{chunk-JVNQNKHV.js → chunk-PHIQHIRJ.js} +1 -1
- package/dist/{chunk-7Q7GQELE.js → chunk-PPQTTJSW.js} +5 -5
- package/dist/{chunk-GPO7F757.js → chunk-QJ2SNBHL.js} +1 -1
- package/dist/{chunk-W246VXU4.js → chunk-QNF7LT7W.js} +2 -2
- package/dist/{chunk-Z4LFCJT6.js → chunk-SWCOWG2C.js} +2 -2
- package/dist/{chunk-SKAML7GB.js → chunk-SYMBXSAT.js} +3 -3
- package/dist/{chunk-5ARXP3BP.js → chunk-UEDRRWZ3.js} +3 -3
- package/dist/{chunk-LSFP57LI.js → chunk-VB4QD4WN.js} +273 -122
- package/dist/{chunk-RJZZFAXS.js → chunk-VKYU4HHW.js} +1 -1
- package/dist/{chunk-2YPOSVC7.js → chunk-WEQMLC7P.js} +3 -3
- package/dist/{chunk-ANFNZCXZ.js → chunk-WSVE5QGL.js} +4 -4
- package/dist/{claude-launcher-LYGS66AC.js → claude-launcher-GGZEWVYJ.js} +1 -1
- package/dist/{cli-7S4PEKAV.js → cli-IG52447Q.js} +110 -110
- package/dist/{command-GQVFZHJ2.js → command-NSTOWAZ6.js} +26 -26
- package/dist/{config-5NWSCHIO.js → config-YPUOOZB6.js} +8 -8
- package/dist/{connect-cmd-HB3K3AHE.js → connect-cmd-RPEEANNE.js} +5 -5
- package/dist/{container-start-WRD3YZQR.js → container-start-OOBTGHWF.js} +32 -32
- package/dist/{context-show-cmd-RJIQS2KF.js → context-show-cmd-R5WCECOT.js} +6 -6
- package/dist/{control-plane-launch-TS4DFJF4.js → control-plane-launch-55CJGYBK.js} +5 -5
- package/dist/{demo-record-cmd-VVZGUCWB.js → demo-record-cmd-SFOWQPL7.js} +4 -4
- package/dist/{demo-voice-cmd-3ADGIWK6.js → demo-voice-cmd-ZOBRVHOK.js} +12 -12
- package/dist/{docker-5VGCFZV2.js → docker-VPJW5LXB.js} +6 -6
- package/dist/{doctor-N4I6IEKP.js → doctor-O2EJAPZB.js} +70 -27
- package/dist/{emit-artifact-cmd-WJT7AXTZ.js → emit-artifact-cmd-HBFYBXJR.js} +10 -10
- package/dist/{emit-criteria-cmd-45IYB535.js → emit-criteria-cmd-TPUL7M2R.js} +7 -7
- package/dist/{emit-demo-cmd-AIIQNPXS.js → emit-demo-cmd-5CUT7W3R.js} +12 -12
- package/dist/{emit-finding-cmd-6YTJK2NA.js → emit-finding-cmd-IKHGMACP.js} +7 -7
- package/dist/{emit-result-cmd-TZGFY743.js → emit-result-cmd-F7CI6SNZ.js} +9 -9
- package/dist/{emit-step-cmd-LGBTIAXC.js → emit-step-cmd-DVEKGHK7.js} +7 -7
- package/dist/{exec-client-LR67CA24.js → exec-client-H2JG36OS.js} +3 -3
- package/dist/find-unit-ACTOZVVS.js +19 -0
- package/dist/{findings-cmd-ETJXUDQI.js → findings-cmd-ODKZ462L.js} +7 -7
- package/dist/{fleet-readiness-MYIMDBF7.js → fleet-readiness-UHCBNW6A.js} +5 -5
- package/dist/{governing-source-GBJTVMK2.js → governing-source-SRECHKPR.js} +9 -9
- package/dist/{guest-init-GXPOW53F.js → guest-init-6FUC4XZX.js} +4 -4
- package/dist/{hook-fast-5WOGLR7V.js → hook-fast-WM6YZVBJ.js} +1 -1
- package/dist/{host-checks-33ZTDTSH.js → host-checks-FLIHLR35.js} +30 -30
- package/dist/{pending-6DDSCXUD.js → host-key-OSWPVMIA.js} +3 -3
- package/dist/{image-tag-OYHGRHVV.js → image-tag-LF3NEGSL.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-OXCOPKHP.js → init-LPD75DCX.js} +23 -23
- package/dist/{init-2YOAKLDN.js → init-OX677NNB.js} +23 -23
- package/dist/{init-cmd-BUWWUQKM.js → init-cmd-ZCLVC5RR.js} +10 -10
- package/dist/{init-update-TXQHBY3H.js → init-update-POKSLQDQ.js} +8 -8
- package/dist/{install-cmd-VZGXSS73.js → install-cmd-6SQVZEXL.js} +5 -5
- package/dist/{logs-42QPBCMC.js → logs-QHXZTSKZ.js} +2 -2
- package/dist/{loop-M3XDFD6O.js → loop-ELTO36MN.js} +37 -37
- package/dist/{machine-3BI2SGAK.js → machine-7VPFAC6L.js} +23 -23
- package/dist/{mcp-serve-cmd-LYJQO6U4.js → mcp-serve-cmd-J32K42HM.js} +4 -4
- package/dist/{paths-QLFRPIKS.js → paths-4ZGWWNTG.js} +2 -2
- package/dist/{host-key-GAZM4EOH.js → pending-CRXJKKKI.js} +3 -3
- package/dist/{pidfile-WLZ427QQ.js → pidfile-VLZPRIBZ.js} +3 -3
- package/dist/{record-WGCMQLQS.js → record-4ZJPJTWO.js} +3 -3
- package/dist/{runner-env-6FSJOSWS.js → runner-env-W53VDVOK.js} +10 -10
- package/dist/{runner-identity-XODZ7YBP.js → runner-identity-BH42S2MU.js} +6 -6
- package/dist/{runner-key-KMTC4NCQ.js → runner-key-ESAZRV3A.js} +23 -23
- package/dist/{session-sender-U54EQJNR.js → session-sender-UB45MUKV.js} +10 -10
- package/dist/{spec-cmd-EM24GTAM.js → spec-cmd-H5B55O5L.js} +8 -8
- package/dist/{status-WVCQCBDQ.js → status-L2OYAZHY.js} +30 -30
- package/dist/{sync-cmd-Y5RKWVF7.js → sync-cmd-IWA5ZTI2.js} +9 -9
- package/dist/{update-steps-2D4YQAW2.js → update-steps-FWQ5ASZ6.js} +31 -31
- package/dist/{watch-X5VYY4LH.js → watch-NOEBVS6U.js} +9 -9
- package/dist/{work-claim-cmd-IU3YJQKR.js → work-claim-cmd-7P7U3OQ6.js} +14 -14
- package/dist/{work-cmd-LUKJHAMH.js → work-cmd-77GUT7LY.js} +7 -7
- package/dist/{work-comment-cmd-BDNFAVKL.js → work-comment-cmd-VS3BSPGM.js} +8 -8
- package/dist/{work-demo-cmd-GPDJHU6F.js → work-demo-cmd-S3GXBYIA.js} +7 -7
- package/dist/{work-logs-cmd-B6EX4RPE.js → work-logs-cmd-6BXIINCM.js} +7 -7
- package/dist/{work-open-pr-cmd-TRXDCMSG.js → work-open-pr-cmd-EPOFWJDC.js} +8 -8
- package/dist/{work-pr-cmd-5GUR5SIU.js → work-pr-cmd-DYSYOP74.js} +7 -7
- package/dist/{work-proofs-cmd-5BYAAW3H.js → work-proofs-cmd-DS2VX4E4.js} +8 -8
- package/dist/{work-proofs-record-USD4JWFP.js → work-proofs-record-LIQGUDWH.js} +15 -15
- package/dist/{work-stop-cmd-J47GZB2N.js → work-stop-cmd-HYQTDNUY.js} +7 -7
- package/package.json +1 -1
- package/dist/find-unit-YGDFVHVU.js +0 -19
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
4
|
-
import { reportFailedStart, fitImageBuildMemory } from './chunk-
|
|
4
|
+
import { reportFailedStart, fitImageBuildMemory } from './chunk-GMEXR6PY.js';
|
|
5
5
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
6
6
|
import { RUNNER_PROTOCOL } from './chunk-MH6QLXUO.js';
|
|
7
|
-
import { writePendingUpdate } from './chunk-
|
|
8
|
-
import { renderUpdateSteps } from './chunk-
|
|
9
|
-
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-
|
|
10
|
-
import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, readProvisionOut, workdirProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, startSender, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, serveLease, vmAlive, writeGuestGhConfig, ALREADY_RELEASED, inTeardown } from './chunk-
|
|
7
|
+
import { writePendingUpdate } from './chunk-77D5ENBA.js';
|
|
8
|
+
import { renderUpdateSteps } from './chunk-SYMBXSAT.js';
|
|
9
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-GET5HKLM.js';
|
|
10
|
+
import { releaseLease, isUnfinished, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, readProvisionOut, workdirProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, startSender, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, serveLease, vmAlive, writeGuestGhConfig, ALREADY_RELEASED, inTeardown } from './chunk-PBI4CM4M.js';
|
|
11
11
|
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
12
|
-
import { realBlockedProbes, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, sliceMemoryOf } from './chunk-
|
|
13
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-
|
|
12
|
+
import { realBlockedProbes, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, sliceMemoryOf, createHousekeepingDocker, housekeepingDockerIfReachable, KIND_LABEL, RECIPE_KEY_LABEL } from './chunk-3E7QAXUW.js';
|
|
13
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-I4YOWQH7.js';
|
|
14
14
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
15
|
-
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, setUpRunnerCgroup, sweepImageBuilders, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-
|
|
16
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-
|
|
17
|
-
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-
|
|
15
|
+
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, HELPER_ENV, setUpRunnerCgroup, sweepImageBuilders, stoppedHelperReason, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-VB4QD4WN.js';
|
|
16
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-PPQTTJSW.js';
|
|
17
|
+
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-LBKCYEJT.js';
|
|
18
18
|
import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
|
|
19
|
-
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-
|
|
20
|
-
import { freeBytes, formatBytes, allocatedBytes
|
|
21
|
-
import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun,
|
|
22
|
-
import { claimPidFile, writePidFile, readPidFile
|
|
19
|
+
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-GXMMILQ4.js';
|
|
20
|
+
import { freeBytes, formatBytes, allocatedBytes } from './chunk-EGJY6MBC.js';
|
|
21
|
+
import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, readJobFileChecked } from './chunk-AHWMY3MS.js';
|
|
22
|
+
import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-3X6OSXSB.js';
|
|
23
23
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
24
|
-
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-
|
|
25
|
-
import { loadHostKey, ensureHostKey, signerFor } from './chunk-
|
|
24
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-GJYGOFF3.js';
|
|
25
|
+
import { loadHostKey, ensureHostKey, signerFor } from './chunk-VKYU4HHW.js';
|
|
26
26
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
27
|
-
import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, imagesDir, rootfsDir, builderCacheDiskPath } from './chunk-
|
|
28
|
-
import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential, fdName } from './chunk-
|
|
27
|
+
import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, imagesDir, rootfsDir, builderCacheDiskPath } from './chunk-AJTGTSNA.js';
|
|
28
|
+
import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential, fdName } from './chunk-L2OARQKP.js';
|
|
29
29
|
import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-MESOOLF4.js';
|
|
30
|
-
import { randomBytes } from 'crypto';
|
|
31
|
-
import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync,
|
|
32
|
-
import { totalmem, constants } from 'os';
|
|
30
|
+
import { randomBytes, createHash } from 'crypto';
|
|
31
|
+
import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync, lstatSync } from 'fs';
|
|
32
|
+
import { totalmem, userInfo, constants } from 'os';
|
|
33
33
|
import { join, dirname } from 'path';
|
|
34
34
|
|
|
35
35
|
createRequire(import.meta.url);
|
|
@@ -369,9 +369,9 @@ function retryFailure(version, err) {
|
|
|
369
369
|
}
|
|
370
370
|
return { outcome: "retrying", reason: messageOf(err) };
|
|
371
371
|
}
|
|
372
|
-
function finish(args,
|
|
373
|
-
let update = { from: args.own, to: args.version, outcome:
|
|
374
|
-
if (
|
|
372
|
+
function finish(args, failure) {
|
|
373
|
+
let update = { from: args.own, to: args.version, outcome: failure.outcome, reason: failure.reason, at: isoAt(args.now) };
|
|
374
|
+
if (failure.outcome === "retrying") {
|
|
375
375
|
const previous = readLastUpdate(args.configPath);
|
|
376
376
|
const attempts = previous?.to === args.version && previous.outcome === "retrying" ? (previous.attempts ?? 1) + 1 : 1;
|
|
377
377
|
update = { ...update, attempts };
|
|
@@ -381,16 +381,16 @@ function finish(args, failure2) {
|
|
|
381
381
|
} catch (err) {
|
|
382
382
|
args.log.error(`could not record the update attempt: ${messageOf(err)}`);
|
|
383
383
|
}
|
|
384
|
-
if (
|
|
384
|
+
if (failure.outcome === "retrying") {
|
|
385
385
|
return {
|
|
386
386
|
kind: "retrying",
|
|
387
|
-
reason:
|
|
388
|
-
detail:
|
|
387
|
+
reason: failure.reason,
|
|
388
|
+
detail: failure.detail ?? failure.reason,
|
|
389
389
|
attempts: update.attempts ?? 1,
|
|
390
390
|
retryAtMs: retryAfterMs(update)
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
return { kind: "failed", outcome:
|
|
393
|
+
return { kind: "failed", outcome: failure.outcome, reason: failure.reason };
|
|
394
394
|
}
|
|
395
395
|
async function earlyFailure(args) {
|
|
396
396
|
const current = currentVersion(args.configPath);
|
|
@@ -421,8 +421,8 @@ async function earlyFailure(args) {
|
|
|
421
421
|
return void 0;
|
|
422
422
|
}
|
|
423
423
|
async function preflightUpdate(args) {
|
|
424
|
-
const
|
|
425
|
-
return
|
|
424
|
+
const failure = await earlyFailure(args);
|
|
425
|
+
return failure === void 0 ? void 0 : finish(args, failure);
|
|
426
426
|
}
|
|
427
427
|
async function prepareUpdate(args) {
|
|
428
428
|
const { configPath, version, deps } = args;
|
|
@@ -536,150 +536,6 @@ function settleUpdate(args) {
|
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
|
|
539
|
-
// src/runner/housekeeping/docker.ts
|
|
540
|
-
var KIND_LABEL = "ai.outerlayer.kind";
|
|
541
|
-
var RECIPE_KEY_LABEL = "ai.outerlayer.recipe-key";
|
|
542
|
-
var NO_BUILDER = /no builder .* found/i;
|
|
543
|
-
function failure(result, what) {
|
|
544
|
-
return new Error(`${what}: ${result.stderr.trim() || `docker exited ${result.status}`}`);
|
|
545
|
-
}
|
|
546
|
-
function labelled(stdout, runnerId) {
|
|
547
|
-
const found = [];
|
|
548
|
-
for (const line of stdout.split("\n")) {
|
|
549
|
-
const [key = "", build = "", runner = ""] = line.replace(/\r?\n$/, "").split(" ");
|
|
550
|
-
if (key.trim() === "" || build === "") continue;
|
|
551
|
-
if (runner !== "" && runner !== runnerId) continue;
|
|
552
|
-
found.push({ key: key.trim(), build, owned: runner === runnerId });
|
|
553
|
-
}
|
|
554
|
-
return found;
|
|
555
|
-
}
|
|
556
|
-
function decimalUnits() {
|
|
557
|
-
return { b: 1, kb: 1e3, mb: 1e6, gb: 1e9, tb: 1e12, pb: 1e15 };
|
|
558
|
-
}
|
|
559
|
-
function parsePrunedBytes(stdout) {
|
|
560
|
-
const match = /^Total(?: reclaimed space)?:\s*([\d.]+)\s*([A-Za-z]*)\s*$/im.exec(stdout);
|
|
561
|
-
if (match === null) return 0;
|
|
562
|
-
const unit = decimalUnits()[match[2].toLowerCase() || "b"];
|
|
563
|
-
return unit === void 0 ? 0 : Math.round(Number(match[1]) * unit);
|
|
564
|
-
}
|
|
565
|
-
function createHousekeepingDocker(deps) {
|
|
566
|
-
const run = deps.run ?? spawnRun;
|
|
567
|
-
return {
|
|
568
|
-
async listBuildContainers() {
|
|
569
|
-
const result = await run("docker", [
|
|
570
|
-
"ps",
|
|
571
|
-
"--all",
|
|
572
|
-
"--no-trunc",
|
|
573
|
-
"--filter",
|
|
574
|
-
`label=${BUILD_LABEL}`,
|
|
575
|
-
"--format",
|
|
576
|
-
`{{.ID}} {{.Label "${BUILD_LABEL}"}} {{.Label "${RUNNER_LABEL}"}}`
|
|
577
|
-
]);
|
|
578
|
-
if (result.status !== 0) throw failure(result, "docker ps");
|
|
579
|
-
return labelled(result.stdout, deps.runnerId).map(({ key, build, owned }) => ({ id: key, build, owned }));
|
|
580
|
-
},
|
|
581
|
-
async listBuildVolumes() {
|
|
582
|
-
const result = await run("docker", [
|
|
583
|
-
"volume",
|
|
584
|
-
"ls",
|
|
585
|
-
"--filter",
|
|
586
|
-
`label=${BUILD_LABEL}`,
|
|
587
|
-
"--format",
|
|
588
|
-
`{{.Name}} {{.Label "${BUILD_LABEL}"}} {{.Label "${RUNNER_LABEL}"}}`
|
|
589
|
-
]);
|
|
590
|
-
if (result.status !== 0) throw failure(result, "docker volume ls");
|
|
591
|
-
return labelled(result.stdout, deps.runnerId).map(({ key, build, owned }) => ({ name: key, build, owned }));
|
|
592
|
-
},
|
|
593
|
-
async removeContainer(id) {
|
|
594
|
-
const result = await run("docker", ["rm", "--force", "--volumes", id]);
|
|
595
|
-
if (result.status !== 0) throw failure(result, `docker rm ${id}`);
|
|
596
|
-
},
|
|
597
|
-
async removeVolume(name) {
|
|
598
|
-
const result = await run("docker", ["volume", "rm", "--force", name]);
|
|
599
|
-
if (result.status !== 0) throw failure(result, `docker volume rm ${name}`);
|
|
600
|
-
},
|
|
601
|
-
async imageState(ref) {
|
|
602
|
-
const result = await run("docker", ["image", "inspect", "--format", "{{.Id}}", ref]);
|
|
603
|
-
if (result.status === 0) return "present";
|
|
604
|
-
return /no such image|not found/i.test(result.stderr) ? "missing" : "unknown";
|
|
605
|
-
},
|
|
606
|
-
async listDanglingImages() {
|
|
607
|
-
const listed = await run("docker", [
|
|
608
|
-
"image",
|
|
609
|
-
"ls",
|
|
610
|
-
"--all",
|
|
611
|
-
"--no-trunc",
|
|
612
|
-
"--quiet",
|
|
613
|
-
"--filter",
|
|
614
|
-
"dangling=true",
|
|
615
|
-
"--filter",
|
|
616
|
-
`label=${KIND_LABEL}`,
|
|
617
|
-
"--filter",
|
|
618
|
-
`label=${RUNNER_LABEL}=${deps.runnerId}`
|
|
619
|
-
]);
|
|
620
|
-
if (listed.status !== 0) throw failure(listed, "docker image ls");
|
|
621
|
-
const ids = [...new Set(listed.stdout.split("\n").map((l) => l.trim()).filter(Boolean))];
|
|
622
|
-
if (ids.length === 0) return [];
|
|
623
|
-
const inspected = await run("docker", ["image", "inspect", ...ids]);
|
|
624
|
-
if (inspected.status !== 0) throw failure(inspected, "docker image inspect");
|
|
625
|
-
return JSON.parse(inspected.stdout).map((row) => ({
|
|
626
|
-
id: row.Id,
|
|
627
|
-
size: row.Size ?? 0,
|
|
628
|
-
labels: row.Config?.Labels ?? {}
|
|
629
|
-
}));
|
|
630
|
-
},
|
|
631
|
-
async listLabelledImages() {
|
|
632
|
-
const listed = await run("docker", ["image", "ls", "--all", "--no-trunc", "--quiet", "--filter", `label=${KIND_LABEL}`, "--filter", `label=${RUNNER_LABEL}=${deps.runnerId}`]);
|
|
633
|
-
if (listed.status !== 0) throw failure(listed, "docker image ls");
|
|
634
|
-
const ids = [...new Set(listed.stdout.split("\n").map((l) => l.trim()).filter(Boolean))];
|
|
635
|
-
if (ids.length === 0) return [];
|
|
636
|
-
const inspected = await run("docker", ["image", "inspect", ...ids]);
|
|
637
|
-
if (inspected.status !== 0) throw failure(inspected, "docker image inspect");
|
|
638
|
-
return JSON.parse(inspected.stdout).map((row) => ({
|
|
639
|
-
id: row.Id,
|
|
640
|
-
size: row.Size ?? 0,
|
|
641
|
-
labels: row.Config?.Labels ?? {},
|
|
642
|
-
tags: (row.RepoTags ?? []).filter((tag) => tag !== "<none>:<none>"),
|
|
643
|
-
createdMs: Date.parse(row.Created ?? "")
|
|
644
|
-
}));
|
|
645
|
-
},
|
|
646
|
-
async removeImage(id) {
|
|
647
|
-
const result = await run("docker", ["rmi", id]);
|
|
648
|
-
if (result.status !== 0) throw failure(result, `docker rmi ${id}`);
|
|
649
|
-
},
|
|
650
|
-
async removeBuilder() {
|
|
651
|
-
const inspected = await run("docker", ["buildx", "inspect", deps.builder]);
|
|
652
|
-
if (inspected.status !== 0 && NO_BUILDER.test(inspected.stderr)) return void 0;
|
|
653
|
-
const df = await run("docker", ["system", "df", "-v"]);
|
|
654
|
-
const freedBytes = df.status === 0 ? volumeBytes(df.stdout, /* @__PURE__ */ new Set([`buildx_buildkit_${deps.builder}0_state`])) : 0;
|
|
655
|
-
const result = await run("docker", ["buildx", "rm", deps.builder]);
|
|
656
|
-
if (result.status !== 0 && NO_BUILDER.test(result.stderr)) return void 0;
|
|
657
|
-
if (result.status !== 0) throw failure(result, "docker buildx rm");
|
|
658
|
-
return { freedBytes };
|
|
659
|
-
},
|
|
660
|
-
async builderPrune(keepBytes) {
|
|
661
|
-
const inspected = await run("docker", ["buildx", "inspect", deps.builder]);
|
|
662
|
-
if (inspected.status !== 0 && NO_BUILDER.test(inspected.stderr)) return void 0;
|
|
663
|
-
const status = inspected.status === 0 ? /^Status:\s*(\S+)/m.exec(inspected.stdout)?.[1] : void 0;
|
|
664
|
-
if (status !== void 0 && status !== "running") return void 0;
|
|
665
|
-
const result = await run("docker", ["buildx", "prune", "--builder", deps.builder, "--force", "--max-used-space", String(keepBytes)]);
|
|
666
|
-
if (result.status !== 0 && (NO_BUILDER.test(result.stderr) || /driver not running/i.test(result.stderr))) return void 0;
|
|
667
|
-
if (result.status !== 0) throw failure(result, "docker buildx prune");
|
|
668
|
-
return { freedBytes: parsePrunedBytes(result.stdout) };
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
async function housekeepingDockerIfReachable(deps) {
|
|
673
|
-
const run = deps.run ?? spawnRun;
|
|
674
|
-
try {
|
|
675
|
-
const answered = await run("docker", ["version", "--format", "{{.Server.Version}}"]);
|
|
676
|
-
if (answered.status !== 0) return void 0;
|
|
677
|
-
} catch {
|
|
678
|
-
return void 0;
|
|
679
|
-
}
|
|
680
|
-
return createHousekeepingDocker(deps);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
539
|
// src/runner/housekeeping/select.ts
|
|
684
540
|
var DAY_MS = 864e5;
|
|
685
541
|
function spoolMaxAgeMs() {
|
|
@@ -1140,6 +996,45 @@ function notEndedByRunnerReason(exit, isolated) {
|
|
|
1140
996
|
function jobNotEndedByRunnerReason(exit, job) {
|
|
1141
997
|
return notEndedByRunnerReason(exit, job.container !== void 0 || job.microvm !== void 0);
|
|
1142
998
|
}
|
|
999
|
+
var HelperInUseError = class extends Error {
|
|
1000
|
+
constructor(socketPath, holder) {
|
|
1001
|
+
super(
|
|
1002
|
+
`another runner already uses the root helper at ${socketPath} (pid ${holder.pid}, config ${holder.config}). A runner stops every microVM build its helper lists that it did not start, so two runners on one helper end each other's builds. Give this runner a service and a helper of its own: outerlayer runner install --service --unit-name <name>.`
|
|
1003
|
+
);
|
|
1004
|
+
this.socketPath = socketPath;
|
|
1005
|
+
this.holder = holder;
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
function helperClaimPath(socketPath, home = userInfo().homedir) {
|
|
1009
|
+
const key = createHash("sha256").update(socketPath).digest("hex").slice(0, 16);
|
|
1010
|
+
return join(home, ".outerlayer", "helper-runners", `${key}.json`);
|
|
1011
|
+
}
|
|
1012
|
+
function readClaim(path) {
|
|
1013
|
+
if (!existsSync(path)) return void 0;
|
|
1014
|
+
try {
|
|
1015
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
1016
|
+
if (typeof parsed.pid !== "number" || typeof parsed.start !== "string") return void 0;
|
|
1017
|
+
return { pid: parsed.pid, start: parsed.start, config: typeof parsed.config === "string" ? parsed.config : "unknown" };
|
|
1018
|
+
} catch {
|
|
1019
|
+
return void 0;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
function claimHelper(socketPath, self, options = {}) {
|
|
1023
|
+
const path = helperClaimPath(socketPath, options.home);
|
|
1024
|
+
const alive = options.isSameProcessFn ?? isSameProcess;
|
|
1025
|
+
const holder = readClaim(path);
|
|
1026
|
+
if (holder !== void 0 && !(holder.pid === self.pid && holder.start === self.start) && alive(holder.pid, holder.start)) {
|
|
1027
|
+
throw new HelperInUseError(socketPath, holder);
|
|
1028
|
+
}
|
|
1029
|
+
mkdirSync(join(path, ".."), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
1030
|
+
writeFileSync(path, JSON.stringify(self), { mode: RUNNER_FILE_MODE });
|
|
1031
|
+
}
|
|
1032
|
+
function releaseHelper(socketPath, self, options = {}) {
|
|
1033
|
+
const path = helperClaimPath(socketPath, options.home);
|
|
1034
|
+
const holder = readClaim(path);
|
|
1035
|
+
if (holder === void 0 || holder.pid !== self.pid || holder.start !== self.start) return;
|
|
1036
|
+
rmSync(path, { force: true });
|
|
1037
|
+
}
|
|
1143
1038
|
|
|
1144
1039
|
// src/runner/loop.ts
|
|
1145
1040
|
var QUEUE_ORDER = ["amend", "implement"];
|
|
@@ -1961,7 +1856,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1961
1856
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
|
|
1962
1857
|
);
|
|
1963
1858
|
async function tryClaimAndStart(state, item, queue) {
|
|
1964
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1859
|
+
const { postJson: postJson2 } = await import('./work-cmd-77GUT7LY.js');
|
|
1965
1860
|
const log = logOf(state);
|
|
1966
1861
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1967
1862
|
const claim = await retrySend(
|
|
@@ -2761,6 +2656,18 @@ async function endStoppedBuild(state, active, where) {
|
|
|
2761
2656
|
);
|
|
2762
2657
|
void endJob(state, active, "interrupted", { stage: "command", reason: COMMAND_LOST_REASON });
|
|
2763
2658
|
}
|
|
2659
|
+
async function endWithoutNetwork(state, active, container, tag) {
|
|
2660
|
+
if (container.network === void 0) return false;
|
|
2661
|
+
const runtime = runtimeOf(state);
|
|
2662
|
+
const helper = await runtime.host.state(container.network);
|
|
2663
|
+
if (helper !== "stopped" && helper !== "missing") return false;
|
|
2664
|
+
if (await runtime.host.state(container.container) !== "running" || active.ending) return false;
|
|
2665
|
+
const reason = helper === "missing" ? `the build's network helper container ${container.network} is gone` : await stoppedHelperReason(runtime, container.network);
|
|
2666
|
+
if (active.ending) return false;
|
|
2667
|
+
logOf(state).error(`${tag} ${reason} \xB7 ending job as failed`);
|
|
2668
|
+
await endJob(state, active, "failed", { stage: "command", reason });
|
|
2669
|
+
return true;
|
|
2670
|
+
}
|
|
2764
2671
|
var DISK_FAILURES_LIMIT = 2;
|
|
2765
2672
|
async function checkDisk(state, active, container, tag) {
|
|
2766
2673
|
const log = logOf(state);
|
|
@@ -2930,6 +2837,7 @@ async function watchTick(state, active, nowMs, logMtimeMs) {
|
|
|
2930
2837
|
return;
|
|
2931
2838
|
}
|
|
2932
2839
|
if (!started) return;
|
|
2840
|
+
if (active.job.container !== void 0 && await endWithoutNetwork(state, active, active.job.container, tag)) return;
|
|
2933
2841
|
if (active.job.container !== void 0 && active.diskChecking !== true) {
|
|
2934
2842
|
active.diskChecking = true;
|
|
2935
2843
|
try {
|
|
@@ -3186,9 +3094,11 @@ async function readStoppedBuild(state, dirPath, job) {
|
|
|
3186
3094
|
const container = job.container;
|
|
3187
3095
|
runtime.leases.get(container.buildId)?.stop();
|
|
3188
3096
|
try {
|
|
3097
|
+
let network;
|
|
3189
3098
|
for (let attempt = 1; attempt <= STOPPED_READ_ATTEMPTS; attempt++) {
|
|
3190
|
-
|
|
3191
|
-
|
|
3099
|
+
network = await ensureNetworkReady(runtime, container);
|
|
3100
|
+
const started = network === void 0 ? await runtime.host.start(container.container) : void 0;
|
|
3101
|
+
if (started?.status === 0) {
|
|
3192
3102
|
const code = await readVolumeExitCode(runtime, dirPath, container);
|
|
3193
3103
|
if (code !== "unreadable") {
|
|
3194
3104
|
await runtime.host.stop(container.container);
|
|
@@ -3198,7 +3108,7 @@ async function readStoppedBuild(state, dirPath, job) {
|
|
|
3198
3108
|
}
|
|
3199
3109
|
if (attempt < STOPPED_READ_ATTEMPTS) await (state.deps.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms))))(STOPPED_READ_RETRY_MS);
|
|
3200
3110
|
}
|
|
3201
|
-
logOf(state).error(`#${job.item} the stopped build's volume could not be read after ${STOPPED_READ_ATTEMPTS} tries`);
|
|
3111
|
+
logOf(state).error(`#${job.item} the stopped build's volume could not be read after ${STOPPED_READ_ATTEMPTS} tries${network === void 0 ? "" : `: ${network}`}`);
|
|
3202
3112
|
return { code: void 0, readable: false };
|
|
3203
3113
|
} catch (err) {
|
|
3204
3114
|
logOf(state).error(`#${job.item} the stopped build's volume could not be read: ${describeCallFailure(err)}`);
|
|
@@ -3279,7 +3189,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3279
3189
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
3280
3190
|
const held = heldClaudeCredential();
|
|
3281
3191
|
const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
|
|
3282
|
-
return (await import('./check-
|
|
3192
|
+
return (await import('./check-C7UKLYZQ.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
3283
3193
|
},
|
|
3284
3194
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
3285
3195
|
log
|
|
@@ -3320,6 +3230,15 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3320
3230
|
mkdirSync(jobsDir(configPath), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
3321
3231
|
const self = { pid: process.pid, start: startTimeOf(process.pid) ?? "" };
|
|
3322
3232
|
claimPidFile(pidFilePath(configPath), self);
|
|
3233
|
+
const helperSocket = process.env[HELPER_ENV];
|
|
3234
|
+
if (helperSocket !== void 0 && helperSocket !== "") {
|
|
3235
|
+
try {
|
|
3236
|
+
claimHelper(helperSocket, { ...self, config: configPath }, deps.helperClaim);
|
|
3237
|
+
} catch (err) {
|
|
3238
|
+
releasePidFile(pidFilePath(configPath), self);
|
|
3239
|
+
throw err instanceof HelperInUseError ? new RunnerStartError(err.message) : err;
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3323
3242
|
check = "cgroup";
|
|
3324
3243
|
const { delegated, refusal } = setUpRunnerCgroup();
|
|
3325
3244
|
if (refusal !== void 0) log.error(`the kernel refused a cgroup step for the runner's service: ${refusal}`);
|
|
@@ -3482,6 +3401,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3482
3401
|
close();
|
|
3483
3402
|
for (const relay of state.containerRuntime?.relays.values() ?? []) void relay.close();
|
|
3484
3403
|
releasePidFile(pidFilePath(configPath), self);
|
|
3404
|
+
if (helperSocket !== void 0 && helperSocket !== "") releaseHelper(helperSocket, self, deps.helperClaim);
|
|
3485
3405
|
log.line("runner exited");
|
|
3486
3406
|
};
|
|
3487
3407
|
const drain = async (onWaiting) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AJTGTSNA.js';
|
|
4
4
|
import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
|
|
5
5
|
import { join, basename, sep, resolve } from 'path';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-32FAPJFD.js';
|
|
4
|
+
import { spoolDir } from './chunk-57WFXHCB.js';
|
|
5
5
|
import { CaptureDaemon } from './chunk-A6PJSNP6.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-
|
|
4
|
-
import { PROXY_WARNING_FLAG } from './chunk-
|
|
3
|
+
import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-D3CT6XQ4.js';
|
|
4
|
+
import { PROXY_WARNING_FLAG } from './chunk-L2OARQKP.js';
|
|
5
5
|
import { RELAY_ID, RELAY_USER } from './chunk-MESOOLF4.js';
|
|
6
6
|
|
|
7
7
|
createRequire(import.meta.url);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { TARGET_TUNNEL, TARGET_LEASE, destinationTarget } from './chunk-MESOOLF4.js';
|
|
4
4
|
import { spawn, spawnSync } from 'child_process';
|
|
5
|
-
import { statSync, readFileSync,
|
|
5
|
+
import { statSync, readFileSync, existsSync, unlinkSync, chmodSync } from 'fs';
|
|
6
6
|
import { join, dirname } from 'path';
|
|
7
7
|
import { request as request$1, createServer } from 'http';
|
|
8
8
|
import { request } from 'https';
|
|
@@ -780,61 +780,8 @@ function primaryOf(repositories) {
|
|
|
780
780
|
|
|
781
781
|
// src/scrub-env.ts
|
|
782
782
|
var SCRUB_ENV_VARIABLE = "OUTERLAYER_SCRUB_ENV";
|
|
783
|
-
var MAVEN_DIR = "maven";
|
|
784
|
-
var MAVEN_SETTINGS_FILE = "settings.xml";
|
|
785
|
-
var MAVEN_NO_PROXY_NOTE = "MAVEN_ARGS names its own global settings file, so the build's Maven gets no proxy from the runner";
|
|
786
|
-
var MAVEN_SPACE_NOTE = "the build's directory has whitespace in its path, which Maven cannot read from MAVEN_ARGS, so its Maven gets no proxy from the runner";
|
|
787
|
-
function namesGlobalSettings(args) {
|
|
788
|
-
return args.split(/\s+/).some((token) => token === "--global-settings" || token.startsWith("--global-settings=") || token === "-gs" || token.startsWith("-gs="));
|
|
789
|
-
}
|
|
790
|
-
function escapeXml(text) {
|
|
791
|
-
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
792
|
-
}
|
|
793
|
-
function mavenSettingsXml(proxyUrl, noProxy) {
|
|
794
|
-
const url = new URL(proxyUrl);
|
|
795
|
-
const host = escapeXml(url.hostname.replace(/^\[|\]$/g, ""));
|
|
796
|
-
const nonProxyHosts = escapeXml(noProxy.split(",").filter((entry) => entry !== "").join("|"));
|
|
797
|
-
const proxy = (protocol) => [
|
|
798
|
-
" <proxy>",
|
|
799
|
-
` <id>outerlayer-${protocol}</id>`,
|
|
800
|
-
" <active>true</active>",
|
|
801
|
-
` <protocol>${protocol}</protocol>`,
|
|
802
|
-
` <host>${host}</host>`,
|
|
803
|
-
` <port>${url.port}</port>`,
|
|
804
|
-
` <nonProxyHosts>${nonProxyHosts}</nonProxyHosts>`,
|
|
805
|
-
" </proxy>"
|
|
806
|
-
].join("\n");
|
|
807
|
-
return [
|
|
808
|
-
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
809
|
-
'<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0">',
|
|
810
|
-
" <proxies>",
|
|
811
|
-
proxy("http"),
|
|
812
|
-
proxy("https"),
|
|
813
|
-
" </proxies>",
|
|
814
|
-
"</settings>",
|
|
815
|
-
""
|
|
816
|
-
].join("\n");
|
|
817
|
-
}
|
|
818
|
-
function writeMavenSettings(buildDir, proxyUrl, noProxy) {
|
|
819
|
-
const dir = join(buildDir, MAVEN_DIR);
|
|
820
|
-
mkdirSync(dir, { recursive: true });
|
|
821
|
-
const file = join(dir, MAVEN_SETTINGS_FILE);
|
|
822
|
-
writeFileSync(file, mavenSettingsXml(proxyUrl, noProxy));
|
|
823
|
-
return file;
|
|
824
|
-
}
|
|
825
|
-
function mavenArgs(settingsFile, team) {
|
|
826
|
-
const own = team?.trim() ?? "";
|
|
827
|
-
if (own !== "" && namesGlobalSettings(own)) return { value: team, skipped: true };
|
|
828
|
-
return { value: own === "" ? `--global-settings ${settingsFile}` : `--global-settings ${settingsFile} ${own}`, skipped: false };
|
|
829
|
-
}
|
|
830
783
|
|
|
831
784
|
// src/runner/container/environment.ts
|
|
832
|
-
function buildMavenSettingsXml() {
|
|
833
|
-
return mavenSettingsXml(PROXY_URL, proxyEnvironment(PROXY_URL).NO_PROXY);
|
|
834
|
-
}
|
|
835
|
-
function writeBuildMavenSettings(buildDir) {
|
|
836
|
-
writeMavenSettings(buildDir, PROXY_URL, proxyEnvironment(PROXY_URL).NO_PROXY);
|
|
837
|
-
}
|
|
838
785
|
var RELAY_PORT = 3128;
|
|
839
786
|
var JOB_MOUNT = "/outerlayer/job";
|
|
840
787
|
var EVAL_INPUT_DIR = `${JOB_MOUNT}/eval-input`;
|
|
@@ -854,7 +801,6 @@ function lifecycleWorkdir(repositories, governingRepository) {
|
|
|
854
801
|
return entry === void 0 ? CHECKOUT_DIR : checkoutPath(entry);
|
|
855
802
|
}
|
|
856
803
|
var MAX_HOSTS = 200;
|
|
857
|
-
var MAVEN_SETTINGS_IN_BUILD = `${JOB_MOUNT}/${MAVEN_DIR}/${MAVEN_SETTINGS_FILE}`;
|
|
858
804
|
function tokenVariables() {
|
|
859
805
|
return ["GH_TOKEN", "GITHUB_TOKEN", "GH_ENTERPRISE_TOKEN", "GITHUB_ENTERPRISE_TOKEN"];
|
|
860
806
|
}
|
|
@@ -863,7 +809,7 @@ function githubVariables() {
|
|
|
863
809
|
}
|
|
864
810
|
var PROXY_URL = `http://127.0.0.1:${RELAY_PORT}`;
|
|
865
811
|
var NO_LOCAL = "localhost,127.0.0.1";
|
|
866
|
-
function
|
|
812
|
+
function standardProxyEnvironment(proxyUrl, alsoNoProxy) {
|
|
867
813
|
const NO_PROXY = alsoNoProxy === void 0 || NO_LOCAL.split(",").includes(alsoNoProxy) ? NO_LOCAL : `${NO_LOCAL},${alsoNoProxy}`;
|
|
868
814
|
return {
|
|
869
815
|
HTTPS_PROXY: proxyUrl,
|
|
@@ -872,7 +818,15 @@ function proxyEnvironment(proxyUrl, alsoNoProxy) {
|
|
|
872
818
|
https_proxy: proxyUrl,
|
|
873
819
|
http_proxy: proxyUrl,
|
|
874
820
|
NO_PROXY,
|
|
875
|
-
no_proxy: NO_PROXY
|
|
821
|
+
no_proxy: NO_PROXY
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
function toolProxyVariables() {
|
|
825
|
+
return ["NODE_USE_ENV_PROXY", "YARN_HTTPS_PROXY", "YARN_HTTP_PROXY"];
|
|
826
|
+
}
|
|
827
|
+
function proxyEnvironment(proxyUrl, alsoNoProxy) {
|
|
828
|
+
return {
|
|
829
|
+
...standardProxyEnvironment(proxyUrl, alsoNoProxy),
|
|
876
830
|
NODE_USE_ENV_PROXY: "1",
|
|
877
831
|
// Yarn 2 and later ignore the variables above and read only their own.
|
|
878
832
|
// Without these, `yarn install` resolves registry names itself, which a
|
|
@@ -887,24 +841,12 @@ function withProxyWarningHidden(options) {
|
|
|
887
841
|
if (given.split(/\s+/).includes(PROXY_WARNING_FLAG)) return given;
|
|
888
842
|
return given === "" ? PROXY_WARNING_FLAG : `${given} ${PROXY_WARNING_FLAG}`;
|
|
889
843
|
}
|
|
890
|
-
function withoutProxyWarningFlag(options) {
|
|
891
|
-
return options.split(/\s+/).filter((option) => option !== "" && option !== PROXY_WARNING_FLAG).join(" ");
|
|
892
|
-
}
|
|
893
|
-
function nodeAcceptsProxyWarningFlag(version) {
|
|
894
|
-
const match = /^v?(\d+)\.(\d+)/.exec(version.trim());
|
|
895
|
-
if (match === null) return true;
|
|
896
|
-
const major = Number(match[1]);
|
|
897
|
-
const minor = Number(match[2]);
|
|
898
|
-
if (major === 20) return minor >= 11;
|
|
899
|
-
if (major === 21) return minor >= 3;
|
|
900
|
-
return major >= 22;
|
|
901
|
-
}
|
|
902
844
|
function runnerLiterals(repository, repositories = [], unpinnedRuntimes) {
|
|
903
845
|
return {
|
|
904
846
|
OUTERLAYER_JOB_DIR: JOB_MOUNT,
|
|
905
847
|
HOME: BUILD_HOME,
|
|
906
848
|
TMPDIR: "/tmp",
|
|
907
|
-
...
|
|
849
|
+
...standardProxyEnvironment(PROXY_URL),
|
|
908
850
|
GIT_TERMINAL_PROMPT: "0",
|
|
909
851
|
GH_CONFIG_DIR: `${JOB_MOUNT}/gh`,
|
|
910
852
|
GH_NO_UPDATE_NOTIFIER: "1",
|
|
@@ -927,7 +869,8 @@ function reservedNames() {
|
|
|
927
869
|
...Object.keys(runnerLiterals("owner/name")),
|
|
928
870
|
...Object.keys(builtInEnvironment(containerBuiltInAddress, void 0)),
|
|
929
871
|
"PATH",
|
|
930
|
-
...tokenVariables()
|
|
872
|
+
...tokenVariables(),
|
|
873
|
+
...toolProxyVariables()
|
|
931
874
|
]);
|
|
932
875
|
}
|
|
933
876
|
function isReservedVariable(name) {
|
|
@@ -974,24 +917,6 @@ function buildEnvironment(input) {
|
|
|
974
917
|
variables.push(name);
|
|
975
918
|
}
|
|
976
919
|
}
|
|
977
|
-
const nodeOptions = {};
|
|
978
|
-
if (input.imageEnv !== void 0) {
|
|
979
|
-
const hide = input.proxyWarning !== false;
|
|
980
|
-
const apply = (value) => hide ? withProxyWarningHidden(value) : value === void 0 ? void 0 : withoutProxyWarningFlag(value);
|
|
981
|
-
if (passed.NODE_OPTIONS !== void 0) passed.NODE_OPTIONS = apply(passed.NODE_OPTIONS);
|
|
982
|
-
else {
|
|
983
|
-
const value = apply(recipe.NODE_OPTIONS ?? input.imageEnv.NODE_OPTIONS);
|
|
984
|
-
if (value !== void 0) nodeOptions.NODE_OPTIONS = value;
|
|
985
|
-
}
|
|
986
|
-
}
|
|
987
|
-
const mavenLiterals = {};
|
|
988
|
-
const notices = [];
|
|
989
|
-
if (input.imageEnv !== void 0 && input.mavenProxy !== false) {
|
|
990
|
-
const { value, skipped } = mavenArgs(MAVEN_SETTINGS_IN_BUILD, passed.MAVEN_ARGS ?? recipe.MAVEN_ARGS ?? input.imageEnv.MAVEN_ARGS);
|
|
991
|
-
if (passed.MAVEN_ARGS !== void 0) passed.MAVEN_ARGS = value;
|
|
992
|
-
else mavenLiterals.MAVEN_ARGS = value;
|
|
993
|
-
if (skipped) notices.push(MAVEN_NO_PROXY_NOTE);
|
|
994
|
-
}
|
|
995
920
|
const destinations = destinationEnvironment(input.config.build?.destinations, containerLocalAddress);
|
|
996
921
|
const builtInLiterals = builtIns ? builtInEnvironment(containerBuiltInAddress, input.config.managed === true ? managedClaudeCredential() : claudeCredential(input.hostEnv)) : {};
|
|
997
922
|
const hooksPath = input.identity?.hooksPath;
|
|
@@ -1009,8 +934,6 @@ function buildEnvironment(input) {
|
|
|
1009
934
|
return {
|
|
1010
935
|
literals: {
|
|
1011
936
|
...recipe,
|
|
1012
|
-
...nodeOptions,
|
|
1013
|
-
...mavenLiterals,
|
|
1014
937
|
...destinations,
|
|
1015
938
|
...runnerLiterals(input.repository, repositoriesOf({ repositories: input.repositories, repository: input.repository, branch: input.branch }), input.unpinnedRuntimes),
|
|
1016
939
|
...builtInLiterals,
|
|
@@ -1019,8 +942,7 @@ function buildEnvironment(input) {
|
|
|
1019
942
|
},
|
|
1020
943
|
passed,
|
|
1021
944
|
variables,
|
|
1022
|
-
skippedTokenVariables
|
|
1023
|
-
notices
|
|
945
|
+
skippedTokenVariables
|
|
1024
946
|
};
|
|
1025
947
|
}
|
|
1026
948
|
function checkEnvironment(input) {
|
|
@@ -1032,10 +954,7 @@ function checkEnvironment(input) {
|
|
|
1032
954
|
hostEnv: input.hostEnv,
|
|
1033
955
|
containerEnv: input.containerEnv,
|
|
1034
956
|
builtIns: false,
|
|
1035
|
-
|
|
1036
|
-
factoryVariables: input.factoryVariables,
|
|
1037
|
-
// A check container is given no settings file, so a `MAVEN_ARGS` naming one would break the check's Maven.
|
|
1038
|
-
mavenProxy: false
|
|
957
|
+
factoryVariables: input.factoryVariables
|
|
1039
958
|
});
|
|
1040
959
|
const withheld = /* @__PURE__ */ new Set(["OUTERLAYER_URL", "OUTERLAYER_API_KEY", ...CLAUDE_CREDENTIAL_VARIABLES]);
|
|
1041
960
|
const literals = { OUTERLAYER_EVAL_INPUT: EVAL_INPUT_DIR, OUTERLAYER_CHECK_ITEMS: CHECK_ITEMS_FILE };
|
|
@@ -1085,4 +1004,4 @@ function routesOf(counts) {
|
|
|
1085
1004
|
return routes.length === 0 ? {} : { routes };
|
|
1086
1005
|
}
|
|
1087
1006
|
|
|
1088
|
-
export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILD_SLICE_MEMORY_ENV, BUILT_IN_NAMES, CHECKOUT_DIR, CHECK_ITEMS_FILE, CLAUDE_CREDENTIAL_ID, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_ENV_FILE, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, FD_SLOTS_PER_BUILD, FD_STORE_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT,
|
|
1007
|
+
export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILD_SLICE_MEMORY_ENV, BUILT_IN_NAMES, CHECKOUT_DIR, CHECK_ITEMS_FILE, CLAUDE_CREDENTIAL_ID, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_ENV_FILE, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, FD_SLOTS_PER_BUILD, FD_STORE_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT, MIN_SYSTEMD, PROXY_WARNING_FLAG, RELAY_PORT, SCRUB_ENV_VARIABLE, authorEnvironment, buildEnvironment, builtInEnvironment, checkEnvironment, checkoutPath, claudeCredential, claudeCredentialVariablesSet, claudeEnvPath, commitIdentityRecord, containerLocalAddress, credentialLineIn, currentClaudeCredential, destinationEnvironment, fdName, headerVariables, heldClaudeCredential, inspectService, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, managedClaudeCredential, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseRunnerEnv, parseUnreachable, primaryOf, proxyEnvironment, readClaudeCredential, realFdStorePort, realInspectProbes, removedClaudeCredentialValues, repositoriesOf, repositoryPath, resolveDestinations, sharedUserEnvironment, startBuildServices, takeClaudeCredential, tokenHeader, withGitConfig, withHooksPath, withProxyWarningHidden, withTokenHeader, withTunnelRecord, withoutCredentialLines };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { isVersion, compareVersions } from './chunk-TQMI335S.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AJTGTSNA.js';
|
|
5
5
|
import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
6
6
|
import { join } from 'path';
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { builtinKind, keepsHostBuilder } from './chunk-
|
|
4
|
-
import { parseSize } from './chunk-
|
|
5
|
-
import { runnerDir } from './chunk-
|
|
6
|
-
import { FD_SLOTS_PER_BUILD, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-
|
|
3
|
+
import { builtinKind, keepsHostBuilder } from './chunk-GXMMILQ4.js';
|
|
4
|
+
import { parseSize } from './chunk-AHWMY3MS.js';
|
|
5
|
+
import { runnerDir } from './chunk-AJTGTSNA.js';
|
|
6
|
+
import { FD_SLOTS_PER_BUILD, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-L2OARQKP.js';
|
|
7
7
|
import { existsSync, readFileSync, writeFileSync, chmodSync, renameSync } from 'fs';
|
|
8
8
|
import { dirname, join } from 'path';
|
|
9
9
|
import { spawnSync } from 'child_process';
|