@outerlayer/cli 0.33.0-next.20261022195547 → 0.33.0-next.20261023003700
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/README.md +5 -0
- package/dist/{agent-setup-RJOVRRHK.js → agent-setup-55ZDEXCS.js} +6 -6
- package/dist/{bridge-BCG2EB7F.js → bridge-NBCXFTT4.js} +2 -2
- package/dist/{build-GKCVFHF4.js → build-SEAQVLD5.js} +5 -5
- package/dist/build-disk-JHTMPRAA.js +16 -0
- package/dist/build-info.json +1 -1
- package/dist/{builder-DPNHJXG3.js → builder-Y4P7QARW.js} +5 -6
- package/dist/{check-64UX323V.js → check-MRYFTLOO.js} +36 -40
- package/dist/{chunk-D3HRAPNF.js → chunk-2EGCI2VW.js} +3424 -2700
- package/dist/{chunk-3MXPS7ED.js → chunk-2N67C6IV.js} +5 -4
- package/dist/{chunk-ZQOSIMKU.js → chunk-2WMZPJVE.js} +6 -3
- package/dist/{chunk-ZXBQ6E72.js → chunk-3RIFVLPO.js} +15 -10
- package/dist/{chunk-UOFBHIOZ.js → chunk-57L2YAJA.js} +1 -1
- package/dist/{chunk-6NWS455T.js → chunk-5THSC6BD.js} +1 -1
- package/dist/{chunk-QL3LPZ67.js → chunk-6LBSAW6I.js} +1 -1
- package/dist/{chunk-WPGBDY73.js → chunk-6RKD7YZ6.js} +1 -1
- package/dist/{chunk-77B36F5K.js → chunk-6Z4SZHV2.js} +4 -3
- package/dist/chunk-7HHNGZS5.js +146 -0
- package/dist/{chunk-DETKDTNL.js → chunk-AU346ENF.js} +3 -2
- package/dist/chunk-B2JURP6A.js +41 -0
- package/dist/{chunk-BCCI32ME.js → chunk-BALIE3BA.js} +36 -7
- package/dist/{chunk-BY36DVJV.js → chunk-BKADJZ7F.js} +3 -2
- package/dist/{chunk-CUBIZBMF.js → chunk-DISTLL2Q.js} +3 -3
- package/dist/{chunk-GN2R5Z7G.js → chunk-DXJTBU7A.js} +3 -3
- package/dist/{chunk-WCELNMXT.js → chunk-EUVE2EAE.js} +2 -2
- package/dist/{chunk-DDS2ISML.js → chunk-F5UL23I2.js} +1 -1
- package/dist/{chunk-43PV5KDB.js → chunk-FR7HWWCF.js} +37 -6
- package/dist/{chunk-JEKENLLA.js → chunk-GH246BGV.js} +1 -1
- package/dist/{chunk-ZRRUWNJS.js → chunk-HE4FBF4T.js} +4 -4
- package/dist/{chunk-W5DOK7BL.js → chunk-HVRQQOMH.js} +3 -3
- package/dist/{chunk-6IKSUAIA.js → chunk-HXA5GIHK.js} +61 -3
- package/dist/{chunk-2QT4JUW3.js → chunk-IP7BIBXJ.js} +1 -35
- package/dist/{chunk-LWTBE5J6.js → chunk-L26V6ILJ.js} +1 -1
- package/dist/{chunk-SK4TWCN3.js → chunk-MZBQTVFG.js} +1 -1
- package/dist/{chunk-YKYCE4HY.js → chunk-MZYOUIY5.js} +1 -1
- package/dist/{chunk-OWDSO3PE.js → chunk-NBZ7XBT6.js} +1 -1
- package/dist/{chunk-TGHBOXKJ.js → chunk-NE63JADS.js} +2 -2
- package/dist/{chunk-AGZNCIIJ.js → chunk-PA6CK6WQ.js} +1 -1
- package/dist/{chunk-L6JFFP3Q.js → chunk-PWH3BEZF.js} +55 -283
- package/dist/{chunk-QDMMW5PC.js → chunk-Q2CMEQV7.js} +2 -2
- package/dist/{chunk-DJWKUQLO.js → chunk-QPWFVE3X.js} +1 -1
- package/dist/{chunk-5BNWAIHN.js → chunk-RQJMN5TJ.js} +47 -7
- package/dist/{chunk-H7A3IQH5.js → chunk-SDU2IE22.js} +72 -28
- package/dist/{chunk-AA6LYZC4.js → chunk-SOI6K5DY.js} +1 -1
- package/dist/{chunk-35IY5HQY.js → chunk-SVDOA4W2.js} +1 -1
- package/dist/{chunk-RBJG5MM4.js → chunk-T5REPMNL.js} +5 -5
- package/dist/{chunk-6KLPC4U7.js → chunk-ULBNTSAD.js} +3 -2
- package/dist/{chunk-CMKY36NV.js → chunk-VT4TTJPG.js} +6 -5
- package/dist/chunk-W2AEL4BJ.js +179 -0
- package/dist/{chunk-6C2YWM6N.js → chunk-XHHTMFCX.js} +1 -1
- package/dist/{chunk-FAZDYI2D.js → chunk-XL2XWWU7.js} +3 -2
- package/dist/{chunk-KLXWS5Z7.js → chunk-YXHKCHWG.js} +4 -4
- package/dist/{chunk-GWDS42JC.js → chunk-Z5IW4DHH.js} +1 -1
- package/dist/{claude-launcher-66GKNIRZ.js → claude-launcher-NTYHJUJM.js} +1 -1
- package/dist/{cli-WICFAKFW.js → cli-K6XGL4EZ.js} +126 -102
- package/dist/{command-VGR24IPI.js → command-7FAIIQGF.js} +25 -26
- package/dist/{config-DUY2PT7K.js → config-QXMUWJAQ.js} +10 -4
- package/dist/{connect-cmd-ADRPR6ES.js → connect-cmd-P5GASVAF.js} +5 -5
- package/dist/{container-start-QX53HKXW.js → container-start-CVP3NTDG.js} +23 -26
- package/dist/context-show-cmd-3EPJ7CJC.js +115 -0
- package/dist/{control-plane-launch-SMHL6MWW.js → control-plane-launch-A3YCHQNQ.js} +5 -5
- package/dist/{docker-GGRJHHBP.js → docker-ANW76BNW.js} +5 -6
- package/dist/{doctor-N3CDJ66I.js → doctor-GJAHI3KU.js} +32 -39
- package/dist/{emit-artifact-cmd-73OWUBH6.js → emit-artifact-cmd-FDPJKGOO.js} +11 -10
- package/dist/{emit-criteria-cmd-D7OR356Y.js → emit-criteria-cmd-3SVGCMJN.js} +8 -7
- package/dist/{emit-demo-cmd-4AV74GMZ.js → emit-demo-cmd-6DF2QIAS.js} +12 -11
- package/dist/{emit-finding-cmd-GEPRJ6KO.js → emit-finding-cmd-TLJWBGQE.js} +8 -7
- package/dist/{emit-result-cmd-N52IABK6.js → emit-result-cmd-CJNVDV5V.js} +10 -9
- package/dist/{emit-step-cmd-CC6MUJ2S.js → emit-step-cmd-347CZO7Y.js} +8 -7
- package/dist/{exec-client-KLI262IX.js → exec-client-7PT4W7JR.js} +3 -3
- package/dist/{findings-cmd-7I72XX2H.js → findings-cmd-LHTYEHYB.js} +8 -7
- package/dist/{fleet-readiness-EZAGL32M.js → fleet-readiness-KGR5AC2J.js} +5 -5
- package/dist/{governing-source-M7ZRJCGY.js → governing-source-JZQZUTMA.js} +10 -9
- package/dist/{guest-init-ZJIE6MU3.js → guest-init-J3F3AEEY.js} +4 -4
- package/dist/{hook-fast-WNKICZ6E.js → hook-fast-6WDMNZG5.js} +1 -1
- package/dist/{pending-I5TY6SQH.js → host-key-UERIQRE6.js} +3 -3
- package/dist/{image-tag-MORUQ4LF.js → image-tag-ADSLWXBA.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-VCWDBOT4.js → init-XDOKWBL2.js} +22 -25
- package/dist/{init-XG4NRZX4.js → init-ZQ5B3TJZ.js} +22 -25
- package/dist/{init-cmd-2CAMWMRP.js → init-cmd-YMGW2WXJ.js} +11 -10
- package/dist/{init-update-NCM4GA3S.js → init-update-X7YLZL6H.js} +8 -8
- package/dist/install-QPA7DQHO.js +19 -0
- package/dist/{install-cmd-HFGINYEE.js → install-cmd-FV7IZ7XF.js} +5 -5
- package/dist/{logs-QSKJ4G6M.js → logs-HI46FO6Z.js} +2 -2
- package/dist/{loop-PXALY3VY.js → loop-UJL2UCUM.js} +36 -40
- package/dist/{machine-AZRL432D.js → machine-2YPAFFCH.js} +22 -21
- package/dist/{mcp-serve-cmd-DQSO6MOL.js → mcp-serve-cmd-7ABBV2QE.js} +4 -4
- package/dist/{paths-KHDFSBEI.js → paths-7HVTDE6J.js} +2 -2
- package/dist/{host-key-REZADWAM.js → pending-5HZACM2V.js} +3 -3
- package/dist/{pidfile-BSY63HIC.js → pidfile-5UDLYPMC.js} +3 -3
- package/dist/{record-7CNTGRLD.js → record-PPZEXAVA.js} +3 -3
- package/dist/runner-env-HOUXKWIJ.js +20 -0
- package/dist/{runner-identity-WGH73DTV.js → runner-identity-KPUVTRLS.js} +5 -6
- package/dist/{runner-key-6BIULOR4.js → runner-key-FUJD66R6.js} +22 -25
- package/dist/{session-sender-MSHKJSBG.js → session-sender-7B3ZDWMC.js} +11 -10
- package/dist/{spec-cmd-AWIMO32E.js → spec-cmd-Q26NE22H.js} +9 -8
- package/dist/{status-BILERIXB.js → status-2KNTILGQ.js} +29 -28
- package/dist/{sync-cmd-BSUZ65CU.js → sync-cmd-SSUYTMLJ.js} +10 -9
- package/dist/{watch-UF6XCGSI.js → watch-L5NCO46E.js} +10 -9
- package/dist/{work-claim-cmd-4FXVAZWF.js → work-claim-cmd-NJNOQFQE.js} +16 -13
- package/dist/{work-cmd-NCP4637R.js → work-cmd-W7WEHMQJ.js} +8 -7
- package/dist/{work-comment-cmd-YNQYVHYS.js → work-comment-cmd-SSUOGVDD.js} +8 -7
- package/dist/{work-logs-cmd-HHWVYQBG.js → work-logs-cmd-WPMWMDX6.js} +8 -7
- package/dist/{work-open-pr-cmd-ALVD7KLY.js → work-open-pr-cmd-NO5YLOXD.js} +9 -8
- package/dist/{work-pr-cmd-KBNFVRB4.js → work-pr-cmd-37B5KECR.js} +8 -7
- package/dist/{work-stop-cmd-DBWNHZJO.js → work-stop-cmd-3BJLXUJ3.js} +8 -7
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -2
- package/dist/build-disk-6QAXMA2J.js +0 -18
- package/dist/chunk-DNKUSXQU.js +0 -241
- package/dist/chunk-I5LGKZ4M.js +0 -107
- package/dist/chunk-P5FC7VUO.js +0 -111
- package/dist/chunk-UXYLWVTQ.js +0 -43
- package/dist/chunk-WBZJWVT2.js +0 -146
- package/dist/chunk-YJLHUKYS.js +0 -38
- package/dist/chunk-YYYRBYWG.js +0 -32
- package/dist/install-NLVYISAV.js +0 -14
- package/dist/runner-env-26NLQI35.js +0 -15
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { releaseLease, isUnfinished,
|
|
3
|
+
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-PWH3BEZF.js';
|
|
4
4
|
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
5
|
-
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-
|
|
5
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-57L2YAJA.js';
|
|
6
6
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
7
7
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
8
|
-
import { fitImageBuildMemory } from './chunk-
|
|
9
|
-
import { RUNNER_PROTOCOL } from './chunk-
|
|
10
|
-
import { writePendingUpdate } from './chunk-
|
|
11
|
-
import {
|
|
12
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, isInLayout, cleanVersions, stagingDir } from './chunk-
|
|
8
|
+
import { fitImageBuildMemory } from './chunk-XHHTMFCX.js';
|
|
9
|
+
import { RUNNER_PROTOCOL } from './chunk-MZYOUIY5.js';
|
|
10
|
+
import { writePendingUpdate } from './chunk-GH246BGV.js';
|
|
11
|
+
import { realBlockedProbes, checkBlockedWithSlots, keepsHostBuilder } from './chunk-7HHNGZS5.js';
|
|
12
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, entryIn, versionDir, startedThroughCurrent, switchCurrent, isInLayout, cleanVersions, stagingDir } from './chunk-NBZ7XBT6.js';
|
|
13
13
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
14
|
-
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, lifecycleSteps, lifecycleFailureReason, prepareBranch, containerCommandExec, setUpRunnerCgroup, sweepImageBuilders, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-
|
|
15
|
-
import { claimPidFile, writePidFile, readPidFile, releasePidFile } from './chunk-
|
|
14
|
+
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, 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, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-2EGCI2VW.js';
|
|
15
|
+
import { claimPidFile, writePidFile, readPidFile, releasePidFile } from './chunk-F5UL23I2.js';
|
|
16
16
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
17
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-
|
|
18
|
-
import { tagToPull, pullInstruction, imageTag, writeUpdateStatus } from './chunk-
|
|
17
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-T5REPMNL.js';
|
|
18
|
+
import { tagToPull, pullInstruction, imageTag, writeUpdateStatus } from './chunk-MZBQTVFG.js';
|
|
19
19
|
import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential } from './chunk-BCCI32ME.js';
|
|
20
|
+
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-RQJMN5TJ.js';
|
|
21
|
+
import { freeBytes, formatBytes, volumeBytes } from './chunk-W2AEL4BJ.js';
|
|
22
|
+
import { writeJobFile, ensureRunnerIdentity, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, BUILD_LABEL, RUNNER_LABEL, readJobFileChecked } from './chunk-FR7HWWCF.js';
|
|
23
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-VT4TTJPG.js';
|
|
24
|
+
import { loadHostKey, ensureHostKey, signerFor } from './chunk-SOI6K5DY.js';
|
|
25
|
+
import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, imagesDir, rootfsDir, builderCacheDiskPath } from './chunk-PA6CK6WQ.js';
|
|
26
|
+
import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential } from './chunk-BALIE3BA.js';
|
|
28
27
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
29
28
|
import { fdName } from './chunk-HACGUL52.js';
|
|
30
29
|
import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-MESOOLF4.js';
|
|
@@ -645,6 +644,16 @@ function createHousekeepingDocker(deps) {
|
|
|
645
644
|
const result = await run("docker", ["rmi", id]);
|
|
646
645
|
if (result.status !== 0) throw failure(result, `docker rmi ${id}`);
|
|
647
646
|
},
|
|
647
|
+
async removeBuilder() {
|
|
648
|
+
const inspected = await run("docker", ["buildx", "inspect", deps.builder]);
|
|
649
|
+
if (inspected.status !== 0 && NO_BUILDER.test(inspected.stderr)) return void 0;
|
|
650
|
+
const df = await run("docker", ["system", "df", "-v"]);
|
|
651
|
+
const freedBytes = df.status === 0 ? volumeBytes(df.stdout, /* @__PURE__ */ new Set([`buildx_buildkit_${deps.builder}0_state`])) : 0;
|
|
652
|
+
const result = await run("docker", ["buildx", "rm", deps.builder]);
|
|
653
|
+
if (result.status !== 0 && NO_BUILDER.test(result.stderr)) return void 0;
|
|
654
|
+
if (result.status !== 0) throw failure(result, "docker buildx rm");
|
|
655
|
+
return { freedBytes };
|
|
656
|
+
},
|
|
648
657
|
async builderPrune(keepBytes) {
|
|
649
658
|
const inspected = await run("docker", ["buildx", "inspect", deps.builder]);
|
|
650
659
|
if (inspected.status !== 0 && NO_BUILDER.test(inspected.stderr)) return void 0;
|
|
@@ -869,7 +878,17 @@ async function runHousekeeping(options) {
|
|
|
869
878
|
} catch (err) {
|
|
870
879
|
log.error(`housekeeping: dangling images could not be listed: ${describeCallFailure(err)}`);
|
|
871
880
|
}
|
|
872
|
-
if (options.
|
|
881
|
+
if (options.removeHostBuilder === true) {
|
|
882
|
+
try {
|
|
883
|
+
const removed = await docker.removeBuilder();
|
|
884
|
+
if (removed !== void 0) {
|
|
885
|
+
freed += removed.freedBytes;
|
|
886
|
+
log.line(`housekeeping: removed the host image builder and its state volume, freed ${formatBytes(removed.freedBytes)}; this runner builds images in the builder microVM`);
|
|
887
|
+
}
|
|
888
|
+
} catch (err) {
|
|
889
|
+
log.error(`housekeeping: the host image builder could not be removed: ${describeCallFailure(err)}`);
|
|
890
|
+
}
|
|
891
|
+
} else if (options.buildCacheMax !== "off") {
|
|
873
892
|
try {
|
|
874
893
|
const pruned = await docker.builderPrune(options.buildCacheMax);
|
|
875
894
|
if (pruned === void 0) {
|
|
@@ -1225,6 +1244,10 @@ function fitForImage(deps, config) {
|
|
|
1225
1244
|
function describeConfig(config) {
|
|
1226
1245
|
return `queues ${config.queues.join(",")} \xB7 concurrency ${config.concurrency} \xB7 poll ${config.pollSeconds}s`;
|
|
1227
1246
|
}
|
|
1247
|
+
function slotsTotalOf(state) {
|
|
1248
|
+
const slots = state.blocked === void 0 ? state.buildSlots ?? state.config.concurrency : state.config.concurrency;
|
|
1249
|
+
return Math.max(slots, state.jobs.size, 1);
|
|
1250
|
+
}
|
|
1228
1251
|
async function sendTickHeartbeat(state, workRequest) {
|
|
1229
1252
|
if (state.heartbeating) {
|
|
1230
1253
|
if (workRequest !== void 0) state.queuedWorkRequest = workRequest;
|
|
@@ -1247,7 +1270,7 @@ async function sendTickHeartbeat(state, workRequest) {
|
|
|
1247
1270
|
cliVersion: state.deps.cliVersion ?? resolveVersion(),
|
|
1248
1271
|
pollSeconds: state.pollTimerSeconds ?? state.config.pollSeconds,
|
|
1249
1272
|
slotsUsed: state.jobs.size,
|
|
1250
|
-
slotsTotal: state
|
|
1273
|
+
slotsTotal: slotsTotalOf(state),
|
|
1251
1274
|
workRequest: next,
|
|
1252
1275
|
lastUpdate: readLastUpdate(state.config.configPath),
|
|
1253
1276
|
lowDisk: state.lowDisk,
|
|
@@ -1660,6 +1683,7 @@ function imageBuilderState(state) {
|
|
|
1660
1683
|
const kind = builtinKind(state.config.hooks.provision);
|
|
1661
1684
|
if (kind !== "container" && kind !== "vm") return "usable";
|
|
1662
1685
|
if (state.deps.container?.buildImage !== void 0 || state.deps.container?.imageHost !== void 0) return "usable";
|
|
1686
|
+
if (!keepsHostBuilder(state.config, state.deps.blocked?.builderDiskPinned)) return "usable";
|
|
1663
1687
|
const memory = state.config.build?.memory ?? "8g";
|
|
1664
1688
|
let probe = state.imageBuilder;
|
|
1665
1689
|
if (probe === void 0 || probe.memory !== memory) probe = state.imageBuilder = { memory, at: 0, running: false };
|
|
@@ -1697,7 +1721,8 @@ function holdWhenBlocked(state, jailer) {
|
|
|
1697
1721
|
inImage: state.deps.image !== void 0,
|
|
1698
1722
|
...state.deps.blocked
|
|
1699
1723
|
};
|
|
1700
|
-
const blocked =
|
|
1724
|
+
const { blocked, slots } = checkBlockedWithSlots(state.config, probes);
|
|
1725
|
+
state.buildSlots = slots;
|
|
1701
1726
|
const log = logOf(state);
|
|
1702
1727
|
if (blocked !== void 0) {
|
|
1703
1728
|
if (state.blocked?.reason !== blocked.reason) log.line(`claiming nothing: ${blocked.reason}`);
|
|
@@ -1753,6 +1778,7 @@ async function housekeepingPass(state) {
|
|
|
1753
1778
|
configPath: state.config.configPath,
|
|
1754
1779
|
keepDays: config.jobsKeepDays,
|
|
1755
1780
|
buildCacheMax: config.buildCacheMax,
|
|
1781
|
+
removeHostBuilder: !keepsHostBuilder(state.config, state.deps.blocked?.builderDiskPinned),
|
|
1756
1782
|
docker: state.deps.housekeeping.docker,
|
|
1757
1783
|
now: state.deps.now ?? (() => /* @__PURE__ */ new Date()),
|
|
1758
1784
|
log: logOf(state)
|
|
@@ -1784,7 +1810,8 @@ async function runTick(state) {
|
|
|
1784
1810
|
const repoFilter = new RepoFilter(state.config.repos);
|
|
1785
1811
|
let filtered = 0;
|
|
1786
1812
|
let attempts = 0;
|
|
1787
|
-
|
|
1813
|
+
const slots = Math.min(state.buildSlots ?? state.config.concurrency, state.config.concurrency);
|
|
1814
|
+
while (state.jobs.size < slots && attempts < state.config.concurrency) {
|
|
1788
1815
|
attempts++;
|
|
1789
1816
|
let claimed = false;
|
|
1790
1817
|
for (const queue of QUEUE_ORDER) {
|
|
@@ -1837,7 +1864,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1837
1864
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
|
|
1838
1865
|
);
|
|
1839
1866
|
async function tryClaimAndStart(state, item, queue) {
|
|
1840
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1867
|
+
const { postJson: postJson2 } = await import('./work-cmd-W7WEHMQJ.js');
|
|
1841
1868
|
const log = logOf(state);
|
|
1842
1869
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1843
1870
|
const claim = await retrySend(
|
|
@@ -2070,6 +2097,7 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
2070
2097
|
log.line(`${tag} provision started`);
|
|
2071
2098
|
const provisionStartedMs = nowOf(state).getTime();
|
|
2072
2099
|
const processMode = isBuiltinProcess(state.config.hooks.provision);
|
|
2100
|
+
const requireBuildSkill = needsBuildSkill(queue, state.config.commands[queue]);
|
|
2073
2101
|
const cliVersion = state.deps.cliVersion ?? resolveVersion();
|
|
2074
2102
|
let workdir;
|
|
2075
2103
|
let cgroup;
|
|
@@ -2094,7 +2122,8 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
2094
2122
|
deadlineMs: startedAt.getTime() + state.config.timeLimitMinutes * 6e4,
|
|
2095
2123
|
fetchImpl: state.deps.fetchImpl,
|
|
2096
2124
|
now: state.deps.now,
|
|
2097
|
-
leaseExpiryMs: () => leaseExpiresAtMs(active.job)
|
|
2125
|
+
leaseExpiryMs: () => leaseExpiresAtMs(active.job),
|
|
2126
|
+
requireBuildSkill
|
|
2098
2127
|
}).catch((err) => ({ ok: false, reason: `provision failed: ${describeCallFailure(err)}`, aborted: false }));
|
|
2099
2128
|
const provisionTook = formatDuration(nowOf(state).getTime() - provisionStartedMs);
|
|
2100
2129
|
if (active.ending) return;
|
|
@@ -2133,7 +2162,8 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
2133
2162
|
deadlineMs: startedAt.getTime() + state.config.timeLimitMinutes * 6e4,
|
|
2134
2163
|
fetchImpl: state.deps.fetchImpl,
|
|
2135
2164
|
now: state.deps.now,
|
|
2136
|
-
leaseTimeLeftMs: leaseTimeLeftFor(state, active)
|
|
2165
|
+
leaseTimeLeftMs: leaseTimeLeftFor(state, active),
|
|
2166
|
+
requireBuildSkill
|
|
2137
2167
|
}).catch((err) => ({ ok: false, reason: `provision failed: ${describeCallFailure(err)}`, aborted: false }));
|
|
2138
2168
|
const provisionTook = formatDuration(nowOf(state).getTime() - provisionStartedMs);
|
|
2139
2169
|
if (active.ending) return;
|
|
@@ -2318,6 +2348,20 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
2318
2348
|
job = { ...active.job, workdir, cgroup };
|
|
2319
2349
|
active.job = job;
|
|
2320
2350
|
writeJobFile(jobFilePath, job);
|
|
2351
|
+
const skillDecision = await decideHostBuildSkill({
|
|
2352
|
+
requireBuildSkill,
|
|
2353
|
+
containerMode,
|
|
2354
|
+
vmMode,
|
|
2355
|
+
workdir,
|
|
2356
|
+
repository: primary?.repository,
|
|
2357
|
+
lookup: (repository) => resolveGoverningSource({ config: state.config, repository, fetchImpl: state.deps.fetchImpl }).catch(() => void 0)
|
|
2358
|
+
});
|
|
2359
|
+
if (skillDecision.kind === "refuse") {
|
|
2360
|
+
log.error(`${tag} ${skillDecision.reason} \xB7 ending job as failed`);
|
|
2361
|
+
await endJob(state, active, "failed", { stage: "provision", reason: skillDecision.reason });
|
|
2362
|
+
return;
|
|
2363
|
+
}
|
|
2364
|
+
if (skillDecision.kind === "warn") log.line(`${tag} warning: the clone has no \`build\` skill; the control plane's context may deliver one, so the command starts`);
|
|
2321
2365
|
if (!containerMode && !vmMode) {
|
|
2322
2366
|
if (existsSync(join(workdir, ".git"))) {
|
|
2323
2367
|
try {
|
|
@@ -2492,7 +2536,7 @@ async function startHostBuild(state, active, repository) {
|
|
|
2492
2536
|
const runtime = runtimeOf(state);
|
|
2493
2537
|
let failed2;
|
|
2494
2538
|
try {
|
|
2495
|
-
await startHostServices({ runtime, config: state.config, build, jobDir: active.dirPath, itemKey: active.job.itemKey, process: false });
|
|
2539
|
+
await startHostServices({ runtime, config: state.config, build, jobDir: active.dirPath, itemKey: active.job.itemKey, process: false, routeLog: (line) => logOf(state).line(`#${active.job.item} ${line}`) });
|
|
2496
2540
|
} catch (err) {
|
|
2497
2541
|
failed2 = describeCallFailure(err);
|
|
2498
2542
|
logOf(state).error(`#${active.job.item} the tunnel and destination servers could not start: ${failed2} \xB7 continuing`);
|
|
@@ -3037,7 +3081,7 @@ async function start(configPath, deps = { fetchImpl: fetch }) {
|
|
|
3037
3081
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
3038
3082
|
const held = heldClaudeCredential();
|
|
3039
3083
|
const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
|
|
3040
|
-
return (await import('./check-
|
|
3084
|
+
return (await import('./check-MRYFTLOO.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
3041
3085
|
},
|
|
3042
3086
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
3043
3087
|
log
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PA6CK6WQ.js';
|
|
4
4
|
import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
|
|
5
5
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
6
6
|
|
|
@@ -5,7 +5,7 @@ import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME
|
|
|
5
5
|
import { installStarterPack } from './chunk-DY7Y7UT4.js';
|
|
6
6
|
import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-HJYBWJAS.js';
|
|
7
7
|
import { C } from './chunk-ANPNT6PM.js';
|
|
8
|
-
import { resolveGitCommonDir, defaultGitRunner } from './chunk-
|
|
8
|
+
import { resolveGitCommonDir, defaultGitRunner } from './chunk-EUVE2EAE.js';
|
|
9
9
|
import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-G63KT5I5.js';
|
|
10
10
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
11
11
|
import { linkedAgentsPath } from './chunk-AVTI3FL5.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { WorkCommandError, postJson } from './chunk-
|
|
4
|
-
import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-
|
|
5
|
-
import { signingFetchFor } from './chunk-
|
|
6
|
-
import { signerFor } from './chunk-
|
|
7
|
-
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-
|
|
3
|
+
import { WorkCommandError, postJson } from './chunk-VT4TTJPG.js';
|
|
4
|
+
import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-EUVE2EAE.js';
|
|
5
|
+
import { signingFetchFor } from './chunk-6RKD7YZ6.js';
|
|
6
|
+
import { signerFor } from './chunk-SOI6K5DY.js';
|
|
7
|
+
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-PA6CK6WQ.js';
|
|
8
8
|
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-FGF52V4V.js';
|
|
9
9
|
import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
10
10
|
import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
3
|
+
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
4
|
+
import { autoConnect } from './chunk-B2JURP6A.js';
|
|
4
5
|
import { resolveRepoIdentity } from './chunk-5DNCFOXA.js';
|
|
5
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
6
|
-
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-
|
|
7
|
+
import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
|
|
7
8
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
8
9
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
9
10
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { detectActiveSession
|
|
4
|
-
import {
|
|
3
|
+
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
4
|
+
import { autoConnect } from './chunk-B2JURP6A.js';
|
|
5
|
+
import { workPageUrl } from './chunk-2WMZPJVE.js';
|
|
5
6
|
import { sanitizeTerminal } from './chunk-EWVYQLD3.js';
|
|
6
7
|
import { resolveRepoIdentity } from './chunk-5DNCFOXA.js';
|
|
7
8
|
import { C } from './chunk-ANPNT6PM.js';
|
|
8
|
-
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-
|
|
9
|
-
import { signRunnerRequest } from './chunk-
|
|
9
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-6RKD7YZ6.js';
|
|
10
|
+
import { signRunnerRequest } from './chunk-SOI6K5DY.js';
|
|
10
11
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
12
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
12
13
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -441,7 +442,7 @@ async function runWorkLinkSession(opts) {
|
|
|
441
442
|
return await linkSession(opts);
|
|
442
443
|
} catch (err) {
|
|
443
444
|
if (opts.logFailures) {
|
|
444
|
-
const { logHookError } = await import('./hook-fast-
|
|
445
|
+
const { logHookError } = await import('./hook-fast-6WDMNZG5.js');
|
|
445
446
|
const reason = err instanceof Error ? err.message : String(err);
|
|
446
447
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
447
448
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-FR7HWWCF.js';
|
|
4
|
+
import { buildsDir, rootfsDir, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-PA6CK6WQ.js';
|
|
5
|
+
import { spawnSync } from 'child_process';
|
|
6
|
+
import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
|
|
7
|
+
import { dirname, join } from 'path';
|
|
8
|
+
|
|
9
|
+
createRequire(import.meta.url);
|
|
10
|
+
function freeBytes(path, statfs = statfsSync) {
|
|
11
|
+
let at = path;
|
|
12
|
+
for (; ; ) {
|
|
13
|
+
try {
|
|
14
|
+
const stats = statfs(at);
|
|
15
|
+
return Number(stats.bavail) * Number(stats.bsize);
|
|
16
|
+
} catch (err) {
|
|
17
|
+
if (err.code !== "ENOENT") return void 0;
|
|
18
|
+
const parent = dirname(at);
|
|
19
|
+
if (parent === at) return void 0;
|
|
20
|
+
at = parent;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
var UNITS = ["B", "KB", "MB", "GB", "TB"];
|
|
25
|
+
function formatBytes(bytes) {
|
|
26
|
+
let value = Math.max(0, bytes);
|
|
27
|
+
let unit = 0;
|
|
28
|
+
while (value >= 1024 && unit < UNITS.length - 1) {
|
|
29
|
+
value /= 1024;
|
|
30
|
+
unit++;
|
|
31
|
+
}
|
|
32
|
+
return unit === 0 ? `${Math.round(value)} B` : `${value.toFixed(1)} ${UNITS[unit]}`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// src/runner/build-disk.ts
|
|
36
|
+
var DEFAULT_CACHE_DISK = "40g";
|
|
37
|
+
function checkDiskFit(input) {
|
|
38
|
+
const limit = parseSize(input.buildDisk);
|
|
39
|
+
if (limit === void 0) return { slots: input.concurrency, fits: true, oneBuildBytes: 0, neededBytes: 0, availableBytes: 0, reservedBytes: 0, message: "" };
|
|
40
|
+
const cacheLimit = parseSize(input.cacheDisk ?? DEFAULT_CACHE_DISK) ?? parseSize(DEFAULT_CACHE_DISK);
|
|
41
|
+
const { freeBytes: free, heldBytes: held, rootDiskBytes: root } = input.facts;
|
|
42
|
+
const reservedBytes = (input.facts.cacheBytes ?? []).reduce((sum, bytes) => sum + Math.max(0, cacheLimit - bytes), 0);
|
|
43
|
+
const oneBuildBytes = limit + root;
|
|
44
|
+
const neededBytes = input.concurrency * oneBuildBytes;
|
|
45
|
+
const availableBytes = Math.max(0, free + held - reservedBytes);
|
|
46
|
+
const slots = Math.min(input.concurrency, Math.floor(availableBytes / oneBuildBytes));
|
|
47
|
+
const oneBuild = root > 0 ? `runner.build.disk ${input.buildDisk} plus a root disk of ${formatBytes(root)}` : `runner.build.disk ${input.buildDisk}`;
|
|
48
|
+
const caches = reservedBytes > 0 ? `, less ${formatBytes(reservedBytes)} that the image-build caches can still grow to (runner.build.cacheDisk ${input.cacheDisk ?? DEFAULT_CACHE_DISK})` : "";
|
|
49
|
+
return {
|
|
50
|
+
slots,
|
|
51
|
+
fits: slots >= input.concurrency,
|
|
52
|
+
oneBuildBytes,
|
|
53
|
+
neededBytes,
|
|
54
|
+
availableBytes,
|
|
55
|
+
reservedBytes,
|
|
56
|
+
message: `${slots} of ${input.concurrency} ${input.concurrency === 1 ? "build" : "builds"} fit: one build can hold ${formatBytes(oneBuildBytes)} (${oneBuild}), runner.concurrency ${input.concurrency} needs ${formatBytes(neededBytes)}, and ${formatBytes(availableBytes)} is counted (${formatBytes(free)} free plus ${formatBytes(held)} held by running builds${caches})`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function allocatedBytes(path) {
|
|
60
|
+
try {
|
|
61
|
+
return statSync(path).blocks * 512;
|
|
62
|
+
} catch {
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function listDir(path) {
|
|
67
|
+
try {
|
|
68
|
+
return readdirSync(path);
|
|
69
|
+
} catch {
|
|
70
|
+
return void 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function logUnreadable(path) {
|
|
74
|
+
process.stderr.write(`outerlayer: cannot list ${path}, so the disk check does not count the image-build cache disks in it
|
|
75
|
+
`);
|
|
76
|
+
}
|
|
77
|
+
function isBuilderDir(dir) {
|
|
78
|
+
return existsSync(join(dir, "image-builder.json"));
|
|
79
|
+
}
|
|
80
|
+
function cacheDiskBytes(configPath, builds, buildEntries) {
|
|
81
|
+
const cache = [];
|
|
82
|
+
const images = imagesDir(configPath);
|
|
83
|
+
if (existsSync(images)) {
|
|
84
|
+
const owners = listDir(images);
|
|
85
|
+
if (owners === void 0) {
|
|
86
|
+
logUnreadable(images);
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
for (const owner of owners) {
|
|
90
|
+
const names = listDir(join(images, owner));
|
|
91
|
+
if (names === void 0) logUnreadable(join(images, owner));
|
|
92
|
+
for (const name of names ?? []) {
|
|
93
|
+
const path = builderCacheDiskPath(configPath, owner, name);
|
|
94
|
+
if (existsSync(path)) cache.push(allocatedBytes(path));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
for (const entry of buildEntries) {
|
|
99
|
+
if (isBuilderDir(join(builds, entry))) cache.push(allocatedBytes(join(builds, entry, "build.ext4")));
|
|
100
|
+
}
|
|
101
|
+
return cache;
|
|
102
|
+
}
|
|
103
|
+
function microVmFacts(configPath) {
|
|
104
|
+
const builds = buildsDir(configPath);
|
|
105
|
+
const free = freeBytes(builds);
|
|
106
|
+
if (free === void 0) return void 0;
|
|
107
|
+
let held = 0;
|
|
108
|
+
let entries = [];
|
|
109
|
+
if (existsSync(builds)) {
|
|
110
|
+
const listed = listDir(builds);
|
|
111
|
+
if (listed === void 0) return void 0;
|
|
112
|
+
entries = listed;
|
|
113
|
+
for (const entry of entries) {
|
|
114
|
+
if (!isBuilderDir(join(builds, entry))) held += allocatedBytes(join(builds, entry, "build.ext4"));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const cacheBytes = cacheDiskBytes(configPath, builds, entries);
|
|
118
|
+
if (cacheBytes === void 0) return void 0;
|
|
119
|
+
let root = 0;
|
|
120
|
+
const roots = rootfsDir(runnerDir(configPath));
|
|
121
|
+
if (existsSync(roots)) {
|
|
122
|
+
const rootEntries = listDir(roots);
|
|
123
|
+
if (rootEntries === void 0) return void 0;
|
|
124
|
+
for (const entry of rootEntries) {
|
|
125
|
+
if (!entry.endsWith(".ext4")) continue;
|
|
126
|
+
try {
|
|
127
|
+
root = Math.max(root, statSync(join(roots, entry)).size);
|
|
128
|
+
} catch {
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return { freeBytes: free, heldBytes: held, rootDiskBytes: root, cacheBytes };
|
|
133
|
+
}
|
|
134
|
+
var DOCKER_TIMEOUT_MS = 1e4;
|
|
135
|
+
var DEFAULT_BUILD_DISK = "40g";
|
|
136
|
+
var DOCKER_CACHE_MS = 6e4;
|
|
137
|
+
var DEFAULT_VOLUMES_DIR = "/var/lib/docker/volumes";
|
|
138
|
+
function runDocker(args, spawn = spawnSync) {
|
|
139
|
+
const result = spawn("docker", args, { encoding: "utf8", timeout: DOCKER_TIMEOUT_MS });
|
|
140
|
+
return result.status === 0 ? result.stdout : void 0;
|
|
141
|
+
}
|
|
142
|
+
var SIZE_UNITS = { b: 1, kb: 1e3, mb: 1e6, gb: 1e9, tb: 1e12 };
|
|
143
|
+
function volumeBytes(dfOutput, names) {
|
|
144
|
+
let total = 0;
|
|
145
|
+
for (const line of dfOutput.split("\n")) {
|
|
146
|
+
const [name, , size] = line.trim().split(/\s+/);
|
|
147
|
+
if (name === void 0 || size === void 0 || !names.has(name)) continue;
|
|
148
|
+
const match = /^([\d.]+)([A-Za-z]+)$/.exec(size);
|
|
149
|
+
const unit = match === null ? void 0 : SIZE_UNITS[match[2].toLowerCase()];
|
|
150
|
+
if (match !== null && unit !== void 0) total += Number(match[1]) * unit;
|
|
151
|
+
}
|
|
152
|
+
return total;
|
|
153
|
+
}
|
|
154
|
+
function containerFacts(cache, configPath, docker, now) {
|
|
155
|
+
if (cache.reading === void 0 || cache.reading.configPath !== configPath || now - cache.reading.at > DOCKER_CACHE_MS) {
|
|
156
|
+
const root = docker(["info", "--format", "{{.DockerRootDir}}"])?.trim();
|
|
157
|
+
const listed = docker(["volume", "ls", "--quiet", "--filter", `label=${BUILD_LABEL}`, "--filter", `label=${RUNNER_LABEL}=${runnerLabelValue(configPath)}`]);
|
|
158
|
+
const names = new Set((listed ?? "").split("\n").map((n) => n.trim()).filter((n) => n !== ""));
|
|
159
|
+
const df = listed === void 0 || names.size === 0 ? void 0 : docker(["system", "df", "-v"]);
|
|
160
|
+
const held = listed === void 0 ? void 0 : names.size === 0 ? 0 : df === void 0 ? void 0 : volumeBytes(df, names);
|
|
161
|
+
cache.reading = {
|
|
162
|
+
at: now,
|
|
163
|
+
configPath,
|
|
164
|
+
held,
|
|
165
|
+
volumes: root === void 0 || root === "" ? DEFAULT_VOLUMES_DIR : join(root, "volumes")
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
if (cache.reading.held === void 0) return void 0;
|
|
169
|
+
const free = freeBytes(cache.reading.volumes);
|
|
170
|
+
return free === void 0 ? void 0 : { freeBytes: free, heldBytes: cache.reading.held, rootDiskBytes: 0 };
|
|
171
|
+
}
|
|
172
|
+
function realBuildDiskProbe(deps = {}) {
|
|
173
|
+
const cache = {};
|
|
174
|
+
const docker = deps.docker ?? ((args) => runDocker(args));
|
|
175
|
+
const now = deps.now ?? Date.now;
|
|
176
|
+
return (kind, configPath) => kind === "vm" ? microVmFacts(configPath) : containerFacts(cache, configPath, docker, now());
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK, DOCKER_CACHE_MS, allocatedBytes, checkDiskFit, formatBytes, freeBytes, realBuildDiskProbe, runDocker, volumeBytes };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-
|
|
3
|
+
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-HE4FBF4T.js';
|
|
4
4
|
import { readFileSync } from 'fs';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
|
|
4
|
-
import { detectActiveSession
|
|
4
|
+
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
5
|
+
import { autoConnect } from './chunk-B2JURP6A.js';
|
|
5
6
|
import { resolveRepoIdentity } from './chunk-5DNCFOXA.js';
|
|
6
7
|
import { C } from './chunk-ANPNT6PM.js';
|
|
7
|
-
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
|
|
8
9
|
import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
|
|
9
10
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
10
11
|
import { CriteriaListSchema } from './chunk-E6CO3MJE.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-
|
|
3
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-F5UL23I2.js';
|
|
4
4
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
5
5
|
import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-3Z3MPR55.js';
|
|
6
|
-
import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, MEDIA_PINS, PLAYWRIGHT_VERSION } from './chunk-
|
|
7
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-
|
|
8
|
-
import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-
|
|
6
|
+
import { GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, CLAUDE_CODE_VERSION, NODE_IMAGE, DEFAULT_BASE_IMAGE, MEDIA_PINS, PLAYWRIGHT_VERSION } from './chunk-NE63JADS.js';
|
|
7
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-PA6CK6WQ.js';
|
|
8
|
+
import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-BALIE3BA.js';
|
|
9
9
|
import { RELAY_ID, RELAY_USER } from './chunk-MESOOLF4.js';
|
|
10
10
|
import { mkdirSync, rmSync, writeFileSync, existsSync, mkdtempSync, cpSync, readFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
|
|
11
11
|
import { tmpdir } from 'os';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { currentLink } from './chunk-
|
|
3
|
+
import { currentLink } from './chunk-NBZ7XBT6.js';
|
|
4
4
|
import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
|
|
5
5
|
import { randomBytes } from 'crypto';
|
|
6
6
|
import { join, dirname, delimiter, resolve } from 'path';
|
|
@@ -252,7 +252,7 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
252
252
|
return 1;
|
|
253
253
|
}
|
|
254
254
|
} else {
|
|
255
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
255
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-A3YCHQNQ.js');
|
|
256
256
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
257
257
|
if (plane.kind === "none") {
|
|
258
258
|
const own2 = ownSkillsDirFor(cwd, home, [], stderr);
|