@outerlayer/cli 0.34.0-next.20261025133402 → 0.34.0-next.20261025210240
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-UXUWLV7O.js → agent-setup-FNDKCPUP.js} +8 -9
- package/dist/{bridge-OWCSVCXL.js → bridge-YJBB4YA3.js} +2 -3
- package/dist/build-B4OKU4MV.js +16 -0
- package/dist/{build-disk-5ZQHYBO3.js → build-disk-ZL46AEN3.js} +6 -8
- package/dist/build-info.json +1 -1
- package/dist/{builder-54GLXGFV.js → builder-XFPWE74N.js} +5 -7
- package/dist/{check-4TQZZOIQ.js → check-QULEN437.js} +43 -43
- package/dist/{chunk-CXQCBAKO.js → chunk-25GRRBTH.js} +1 -1
- package/dist/{chunk-4XYC2663.js → chunk-2D6CKNR7.js} +8 -4
- package/dist/{chunk-IHY457PB.js → chunk-2ILU7UAU.js} +1 -1
- package/dist/{chunk-JEOPIRUR.js → chunk-3EJBI5JW.js} +3 -3
- package/dist/{chunk-TVGLNHEB.js → chunk-3N77LUQI.js} +1 -1
- package/dist/{chunk-ES4ULBAL.js → chunk-4UPET3R7.js} +7 -3
- package/dist/{chunk-MPDLZCXM.js → chunk-5AFPP3GZ.js} +238 -14
- package/dist/{chunk-HAEDLXHA.js → chunk-63IVRRIO.js} +3 -3
- package/dist/{chunk-BTG5NZHN.js → chunk-6OLVVAOK.js} +4 -4
- package/dist/{chunk-3M6UYJSR.js → chunk-AVPLEFQR.js} +3 -3
- package/dist/{chunk-TVOZOOIW.js → chunk-BHSSGVOY.js} +3 -3
- package/dist/{chunk-QOUR4CQ7.js → chunk-CAQCDYKF.js} +2 -2
- package/dist/{chunk-SMMNU65K.js → chunk-DNZYXEMY.js} +13 -12
- package/dist/{chunk-LMICI7AY.js → chunk-EGVHFHY4.js} +3 -3
- package/dist/{chunk-RNVBSRZZ.js → chunk-FD5ASWTG.js} +18 -19
- package/dist/{chunk-NW5PDZYA.js → chunk-FDJPDZSR.js} +1 -1
- package/dist/{chunk-XA6PGME5.js → chunk-FVCHHSHB.js} +3 -3
- package/dist/{chunk-YOBQIXX6.js → chunk-G4W4B33M.js} +182 -3
- package/dist/{chunk-T7N3BAOO.js → chunk-GC5PVMIJ.js} +85 -17
- package/dist/{chunk-CCISO7EQ.js → chunk-HHFZXOBC.js} +12 -14
- package/dist/{chunk-AABYHGVO.js → chunk-INOUUSYI.js} +29 -9
- package/dist/{chunk-KDLQGTN6.js → chunk-JBCOUY4M.js} +2 -2
- package/dist/{chunk-POGPX7LI.js → chunk-JQSZTQSK.js} +24 -30
- package/dist/{chunk-JZD2NTRH.js → chunk-K2UAQWYO.js} +3 -3
- package/dist/{chunk-UC2DKBMS.js → chunk-KM2HLQE3.js} +2 -2
- package/dist/{chunk-XLJLR7EK.js → chunk-MOI2KDLH.js} +1 -1
- package/dist/{chunk-BUF6DSSM.js → chunk-NW26E4YU.js} +3 -3
- package/dist/{chunk-ZV2JJPDS.js → chunk-O4Z2MNNL.js} +6 -6
- package/dist/{chunk-2RBIW2PD.js → chunk-OGPEHSNW.js} +1 -1
- package/dist/{chunk-EZ7L5IZU.js → chunk-OQLF3MQQ.js} +3 -4
- package/dist/{chunk-J246WRLZ.js → chunk-OS7DJOQJ.js} +1 -1
- package/dist/{chunk-O5G6VQGZ.js → chunk-PFHTT4PP.js} +5 -5
- package/dist/{chunk-N7LAEN3T.js → chunk-PXGU3GKY.js} +1 -1
- package/dist/{chunk-WIK5KUGK.js → chunk-QANM5COC.js} +6 -6
- package/dist/{chunk-PSXVAOEB.js → chunk-QQP3S5FU.js} +3 -3
- package/dist/{chunk-AVLLJW5D.js → chunk-RFVIQLNB.js} +5 -5
- package/dist/{chunk-Z76GVJGQ.js → chunk-RHV5SRI2.js} +3 -3
- package/dist/{chunk-75KZUBHD.js → chunk-SI6WDF3U.js} +1 -1
- package/dist/chunk-SUOZYOWO.js +51 -0
- package/dist/{chunk-36T6W5RA.js → chunk-SYVRBBLW.js} +1 -1
- package/dist/{chunk-E34FRRSW.js → chunk-TBKV4L2W.js} +4 -4
- package/dist/{chunk-56ZHWIR2.js → chunk-TFPNPS4Q.js} +1 -1
- package/dist/{chunk-DUPM5LVJ.js → chunk-UMYYYF7B.js} +1 -1
- package/dist/{chunk-IW6Z337K.js → chunk-UN3SQTVL.js} +7 -7
- package/dist/{chunk-3NFZN7H6.js → chunk-UO4FQAOX.js} +16 -12
- package/dist/{chunk-ZWLEUSJW.js → chunk-VJ34F55N.js} +55 -39
- package/dist/{chunk-3RAAYBSG.js → chunk-YHKU2NOZ.js} +1 -1
- package/dist/{chunk-ENFBYN4A.js → chunk-YNMVVQOQ.js} +1 -1
- package/dist/{claude-launcher-JEB5BN7Q.js → claude-launcher-OQZNW7XJ.js} +1 -1
- package/dist/{cli-DY3EGPUB.js → cli-VHQPX2B7.js} +123 -117
- package/dist/{command-ZAXYAZCI.js → command-KFYK3WEF.js} +196 -60
- package/dist/{config-UN3X6AP2.js → config-QASNKYM6.js} +7 -9
- package/dist/{connect-cmd-TWM4FEKD.js → connect-cmd-MEDWMW3L.js} +8 -9
- package/dist/{container-start-JUNBJ7MU.js → container-start-2DHCWV73.js} +34 -36
- package/dist/{context-show-cmd-K5LRMDEO.js → context-show-cmd-VSFCG663.js} +9 -10
- package/dist/{control-plane-launch-LHOV2FPA.js → control-plane-launch-XBGHM7DB.js} +5 -6
- package/dist/{docker-YZKRM7IP.js → docker-TAC6G4VU.js} +5 -7
- package/dist/{doctor-YOAF7QPL.js → doctor-LK6E3XOW.js} +66 -41
- package/dist/{emit-artifact-cmd-SCF2FKKS.js → emit-artifact-cmd-L4REOPWX.js} +13 -14
- package/dist/{emit-cmd-7NMNKDK7.js → emit-cmd-7TU3JBJ2.js} +2 -2
- package/dist/{emit-criteria-cmd-B6CKUWTW.js → emit-criteria-cmd-QVFOQARC.js} +10 -11
- package/dist/{emit-demo-cmd-BNWRETMJ.js → emit-demo-cmd-L4B6OOTV.js} +15 -16
- package/dist/{emit-finding-cmd-TPSHNZNE.js → emit-finding-cmd-YXFCIWMU.js} +10 -11
- package/dist/{emit-result-cmd-J5DXIC2Q.js → emit-result-cmd-NI4LCTUM.js} +12 -13
- package/dist/{emit-step-cmd-NPH46KAO.js → emit-step-cmd-HWAUCZZB.js} +10 -11
- package/dist/{exec-client-ANW4KGMN.js → exec-client-QB4OZRGM.js} +3 -4
- package/dist/find-unit-4UR647S4.js +18 -0
- package/dist/{findings-cmd-4FJDCFL3.js → findings-cmd-O2IBO25E.js} +10 -11
- package/dist/{fleet-readiness-OK6534T6.js → fleet-readiness-NJYTQYTA.js} +5 -6
- package/dist/{governing-source-GNKTNM32.js → governing-source-JCI7VDQ6.js} +12 -13
- package/dist/{guest-init-C6M7YT3U.js → guest-init-IF5LXGUL.js} +4 -5
- package/dist/{hook-fast-LVTJWAG3.js → hook-fast-GPUL7T77.js} +1 -1
- package/dist/host-key-5RU322O3.js +9 -0
- package/dist/{image-tag-53DJPMSZ.js → image-tag-SEMBVB5D.js} +3 -4
- package/dist/index.js +4 -4
- package/dist/{init-RAJKTSPJ.js → init-2CEULE3F.js} +25 -27
- package/dist/{init-JGYMAOD5.js → init-FAIF7KOK.js} +25 -27
- package/dist/{init-cmd-IB3KTYCV.js → init-cmd-HZUUMO45.js} +13 -14
- package/dist/{init-update-VPWSWDY7.js → init-update-TTMFFNMB.js} +12 -13
- package/dist/{install-cmd-NP7GULCD.js → install-cmd-5H6M2KJ7.js} +5 -6
- package/dist/{logs-V6AES5FE.js → logs-6CMB3DO6.js} +2 -3
- package/dist/{loop-ZGDZMVFN.js → loop-7U7MVICV.js} +40 -42
- package/dist/{machine-LJ3VMGS3.js → machine-S3JHOX4V.js} +25 -27
- package/dist/{mcp-serve-cmd-DHGCAMJS.js → mcp-serve-cmd-MWGIN6YL.js} +4 -5
- package/dist/{paths-DMKAJVA5.js → paths-T2DEBI62.js} +2 -3
- package/dist/pending-ERXWVLLG.js +9 -0
- package/dist/{pidfile-XCTXBGA3.js → pidfile-EAD2OEM7.js} +3 -4
- package/dist/{record-RQLGRYWG.js → record-IMXQNHPB.js} +3 -4
- package/dist/{runner-env-AUG2OIP4.js → runner-env-BJPUHAKZ.js} +9 -11
- package/dist/{runner-identity-BQA4SBU6.js → runner-identity-ZCPPC2BJ.js} +5 -7
- package/dist/{runner-key-ZIF7M7YN.js → runner-key-CYSUYKSX.js} +25 -27
- package/dist/{session-sender-VQ4LHJ5K.js → session-sender-5T7BXPKC.js} +13 -14
- package/dist/{spec-cmd-PXM4FJ2O.js → spec-cmd-4ABYAFNZ.js} +11 -12
- package/dist/{status-27EFD2WE.js → status-2AP7J2L7.js} +32 -34
- package/dist/{sync-cmd-VAV7TR2A.js → sync-cmd-34CGNA6T.js} +12 -13
- package/dist/{update-steps-7YLAFW3E.js → update-steps-JQOCCDWO.js} +33 -35
- package/dist/{watch-42XJSTTB.js → watch-6HU7LCUY.js} +12 -13
- package/dist/{work-claim-cmd-HSG4OHFI.js → work-claim-cmd-5QKLHSCR.js} +16 -18
- package/dist/{work-cmd-KCBU3RSD.js → work-cmd-3MKUIE2C.js} +10 -11
- package/dist/{work-comment-cmd-QIP2OUJC.js → work-comment-cmd-ESC3DSHI.js} +11 -12
- package/dist/{work-demo-cmd-6IKAG6ES.js → work-demo-cmd-7S23DGYO.js} +10 -11
- package/dist/{work-logs-cmd-RMKJA4AI.js → work-logs-cmd-46UPNN7Q.js} +10 -11
- package/dist/{work-open-pr-cmd-IAVLUUWW.js → work-open-pr-cmd-JNGTGLIP.js} +11 -12
- package/dist/{work-pr-cmd-3U7SVQII.js → work-pr-cmd-2J2LKETD.js} +10 -11
- package/dist/{work-proofs-cmd-6ZY6ZNNE.js → work-proofs-cmd-HRWTHYSS.js} +11 -12
- package/dist/{work-proofs-record-54GBEUJP.js → work-proofs-record-6OKAT3IC.js} +18 -19
- package/dist/{work-stop-cmd-LH5XY4YL.js → work-stop-cmd-Y22XIVQ6.js} +10 -11
- package/package.json +1 -1
- package/dist/build-4HFDZTUX.js +0 -14
- package/dist/chunk-3Z3MPR55.js +0 -226
- package/dist/chunk-HACGUL52.js +0 -183
- package/dist/host-key-DUGGHAGR.js +0 -10
- package/dist/inspect-DNLXTXLA.js +0 -6
- package/dist/install-QJWJFIWB.js +0 -19
- package/dist/pending-B55JZFOV.js +0 -10
- package/dist/{chunk-2AIOOU3A.js → chunk-KPHRRCUY.js} +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { detectActiveSession } from './chunk-IP7BIBXJ.js';
|
|
4
|
-
import { autoConnect } from './chunk-
|
|
5
|
-
import { workPageUrl } from './chunk-
|
|
6
|
-
import { sanitizeTerminal } from './chunk-MECW77XP.js';
|
|
7
|
-
import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
|
|
4
|
+
import { autoConnect } from './chunk-AVPLEFQR.js';
|
|
5
|
+
import { workPageUrl } from './chunk-FVCHHSHB.js';
|
|
8
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { sanitizeTerminal } from './chunk-MECW77XP.js';
|
|
8
|
+
import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-3N77LUQI.js';
|
|
9
|
+
import { signRunnerRequest } from './chunk-MOI2KDLH.js';
|
|
11
10
|
import { readRepoConnection } from './chunk-BJ3KTMDH.js';
|
|
11
|
+
import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
|
|
12
12
|
import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
|
|
13
13
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
14
14
|
|
|
@@ -446,7 +446,7 @@ async function runWorkLinkSession(opts) {
|
|
|
446
446
|
return await linkSession(opts);
|
|
447
447
|
} catch (err) {
|
|
448
448
|
if (opts.logFailures) {
|
|
449
|
-
const { logHookError } = await import('./hook-fast-
|
|
449
|
+
const { logHookError } = await import('./hook-fast-GPUL7T77.js');
|
|
450
450
|
const reason = err instanceof Error ? err.message : String(err);
|
|
451
451
|
logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
|
|
452
452
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
3
|
+
import { RecipeError, locateRecipe, readRecipe, assertBuildable, runnerLabelValue, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-5AFPP3GZ.js';
|
|
4
|
+
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-4UPET3R7.js';
|
|
5
|
+
import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-YNMVVQOQ.js';
|
|
4
6
|
import { startTimeOf } from './chunk-JBJTC3UU.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-N7LAEN3T.js';
|
|
8
|
-
import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-YOBQIXX6.js';
|
|
7
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-PXGU3GKY.js';
|
|
8
|
+
import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-G4W4B33M.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';
|
|
@@ -346,16 +346,18 @@ function toolsKey(parts) {
|
|
|
346
346
|
|
|
347
347
|
// src/runner/image/prune.ts
|
|
348
348
|
var KIND = "ai.outerlayer.kind";
|
|
349
|
+
var RUNNER = "ai.outerlayer.runner";
|
|
349
350
|
var RECIPE_KEY = "ai.outerlayer.recipe-key";
|
|
350
351
|
var newestFirst = (a, b) => Date.parse(b.createdAt) - Date.parse(a.createdAt);
|
|
351
352
|
function selectPrunable(opts) {
|
|
352
353
|
const used = new Set(opts.inUse);
|
|
353
|
-
const
|
|
354
|
+
const images = opts.runner === void 0 ? opts.images : opts.images.filter((i) => i.labels[RUNNER] === opts.runner);
|
|
355
|
+
const builds = images.filter((i) => i.labels[KIND] === "build").sort(newestFirst);
|
|
354
356
|
const kept = builds.filter((image, index) => index < opts.keep || used.has(image.id));
|
|
355
357
|
const keptKeys = new Set(kept.map((i) => i.labels[RECIPE_KEY]));
|
|
356
358
|
return {
|
|
357
359
|
builds: builds.filter((i) => !kept.includes(i)),
|
|
358
|
-
recipes:
|
|
360
|
+
recipes: images.filter(
|
|
359
361
|
(i) => i.labels[KIND] === "recipe" && !used.has(i.id) && !keptKeys.has(i.labels[RECIPE_KEY])
|
|
360
362
|
)
|
|
361
363
|
};
|
|
@@ -363,6 +365,7 @@ function selectPrunable(opts) {
|
|
|
363
365
|
|
|
364
366
|
// src/runner/image/build.ts
|
|
365
367
|
var KIND2 = "ai.outerlayer.kind";
|
|
368
|
+
var RUNNER2 = "ai.outerlayer.runner";
|
|
366
369
|
var REPOSITORY = "ai.outerlayer.repository";
|
|
367
370
|
var RECIPE_KEY2 = "ai.outerlayer.recipe-key";
|
|
368
371
|
var TOOLS_KEY = "ai.outerlayer.tools-key";
|
|
@@ -458,6 +461,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
458
461
|
const scratchRoot = opts.tmpDir ?? tmpdir();
|
|
459
462
|
const prepared = await prepareImageBuild(opts);
|
|
460
463
|
const { repository, repoRecords, checkout, location, recipe, recipeKey: rKey, toolsKey: tKey, defaultText, claudeCodeVersion, nodeImage, recordDir, logPath } = prepared;
|
|
464
|
+
const runnerLabel = runnerLabelValue(opts.configPath);
|
|
461
465
|
const buildTag = `${TAG_HOST}/build/${repository}:${rKey.slice(0, KEY_PREFIX)}-${tKey.slice(0, KEY_PREFIX)}`;
|
|
462
466
|
const recipeTag = `${TAG_HOST}/recipe/${repository}:${rKey.slice(0, KEY_PREFIX)}`;
|
|
463
467
|
try {
|
|
@@ -482,7 +486,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
482
486
|
if (recipeImage === void 0 && buildImageBefore === void 0) {
|
|
483
487
|
await ensureBuilder();
|
|
484
488
|
mkdirSync(join(repoRecords, LAYOUTS_DIR), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
485
|
-
const labels = { [REPOSITORY]: repository, [KIND2]: "recipe", [RECIPE_KEY2]: rKey };
|
|
489
|
+
const labels = { [REPOSITORY]: repository, [KIND2]: "recipe", [RUNNER2]: runnerLabel, [RECIPE_KEY2]: rKey };
|
|
486
490
|
if (location.kind === "default") {
|
|
487
491
|
const context = mkdtempSync(join(scratchRoot, "ol-image-default-"));
|
|
488
492
|
try {
|
|
@@ -538,7 +542,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
538
542
|
cpSync(opts.guestHelper.path, join(context, "guest", "outerlayer-guest"));
|
|
539
543
|
}
|
|
540
544
|
const dockerfile = toolsDockerfile({ recipeImage: recipeTag, nodeImage, claudeCodeVersion, buildId: opts.cli.buildId, guestHelper: opts.guestHelper !== void 0 });
|
|
541
|
-
const labels = { [REPOSITORY]: repository, [KIND2]: "build", [RECIPE_KEY2]: rKey, [TOOLS_KEY]: tKey };
|
|
545
|
+
const labels = { [REPOSITORY]: repository, [KIND2]: "build", [RUNNER2]: runnerLabel, [RECIPE_KEY2]: rKey, [TOOLS_KEY]: tKey };
|
|
542
546
|
const status = await host.buildDockerfile({ dockerfile, context, tag: buildTag, labels, logPath, base: { ref: recipeTag, layout: keptLayout } });
|
|
543
547
|
if (status !== 0) throw failed("the docker build of the tools layer", status);
|
|
544
548
|
} finally {
|
|
@@ -565,7 +569,7 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
565
569
|
writeRecord(recordDir, report, now().toISOString());
|
|
566
570
|
}
|
|
567
571
|
const removed = [];
|
|
568
|
-
if (toolsBuilt) removed.push(...await prune(host, repository, repoRecords, opts.keep ?? KEEP_BUILD_IMAGES, runnerDir(opts.configPath)));
|
|
572
|
+
if (toolsBuilt) removed.push(...await prune(host, repository, repoRecords, opts.keep ?? KEEP_BUILD_IMAGES, runnerDir(opts.configPath), runnerLabel));
|
|
569
573
|
return {
|
|
570
574
|
reused: !recipeBuilt && !toolsBuilt,
|
|
571
575
|
recipeBuilt,
|
|
@@ -579,8 +583,8 @@ async function buildRepositoryImage(opts, ports) {
|
|
|
579
583
|
prepared.release();
|
|
580
584
|
}
|
|
581
585
|
}
|
|
582
|
-
async function prune(host, repository, repoRecords, keep, runnerDirPath) {
|
|
583
|
-
const { builds, recipes } = selectPrunable({ images: await host.list(repository), inUse: await host.inUse(), keep });
|
|
586
|
+
async function prune(host, repository, repoRecords, keep, runnerDirPath, runnerLabel) {
|
|
587
|
+
const { builds, recipes } = selectPrunable({ images: await host.list(repository), inUse: await host.inUse(), keep, runner: runnerLabel });
|
|
584
588
|
const removed = [];
|
|
585
589
|
for (const image of [...builds, ...recipes]) {
|
|
586
590
|
try {
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { reportFailedStart, fitImageBuildMemory } from './chunk-O4Z2MNNL.js';
|
|
4
|
+
import { writePendingUpdate } from './chunk-TFPNPS4Q.js';
|
|
5
|
+
import { renderUpdateSteps } from './chunk-RHV5SRI2.js';
|
|
6
|
+
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-FD5ASWTG.js';
|
|
7
|
+
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
8
|
+
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-FDJPDZSR.js';
|
|
3
9
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
4
|
-
import { reportFailedStart, fitImageBuildMemory } from './chunk-ZV2JJPDS.js';
|
|
5
10
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
6
|
-
import { writePendingUpdate } from './chunk-56ZHWIR2.js';
|
|
7
|
-
import { renderUpdateSteps } from './chunk-Z76GVJGQ.js';
|
|
8
|
-
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-RNVBSRZZ.js';
|
|
9
|
-
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
10
|
-
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-NW5PDZYA.js';
|
|
11
11
|
import { RUNNER_PROTOCOL } from './chunk-PAK5P2ND.js';
|
|
12
|
-
import { realBlockedProbes, checkBlockedWithSlots
|
|
13
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-
|
|
12
|
+
import { realBlockedProbes, checkBlockedWithSlots } from './chunk-DNZYXEMY.js';
|
|
13
|
+
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-UMYYYF7B.js';
|
|
14
14
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
15
|
-
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, 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, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-AVLLJW5D.js';
|
|
19
|
-
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-36T6W5RA.js';
|
|
15
|
+
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, 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, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-JQSZTQSK.js';
|
|
16
|
+
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-RFVIQLNB.js';
|
|
17
|
+
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-SYVRBBLW.js';
|
|
20
18
|
import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
|
|
21
|
-
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-
|
|
22
|
-
import { freeBytes, formatBytes, volumeBytes } from './chunk-
|
|
23
|
-
import { writeJobFile, ensureRunnerIdentity, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun,
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
19
|
+
import { isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-2D6CKNR7.js';
|
|
20
|
+
import { freeBytes, formatBytes, volumeBytes } from './chunk-KM2HLQE3.js';
|
|
21
|
+
import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, RUNNER_LABEL, BUILD_LABEL, readJobFileChecked } from './chunk-5AFPP3GZ.js';
|
|
22
|
+
import { claimPidFile, writePidFile, readPidFile, releasePidFile } from './chunk-YNMVVQOQ.js';
|
|
23
|
+
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
24
|
+
import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-UN3SQTVL.js';
|
|
25
|
+
import { loadHostKey, ensureHostKey, signerFor } from './chunk-MOI2KDLH.js';
|
|
28
26
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
29
|
-
import {
|
|
27
|
+
import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, spoolDir, imagesDir, rootfsDir, builderCacheDiskPath } from './chunk-PXGU3GKY.js';
|
|
28
|
+
import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential, fdName } from './chunk-G4W4B33M.js';
|
|
30
29
|
import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-MESOOLF4.js';
|
|
31
30
|
import { randomBytes } from 'crypto';
|
|
32
31
|
import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, closeSync, rmSync, lstatSync } from 'fs';
|
|
@@ -614,7 +613,9 @@ function createHousekeepingDocker(deps) {
|
|
|
614
613
|
"--filter",
|
|
615
614
|
"dangling=true",
|
|
616
615
|
"--filter",
|
|
617
|
-
`label=${KIND_LABEL}
|
|
616
|
+
`label=${KIND_LABEL}`,
|
|
617
|
+
"--filter",
|
|
618
|
+
`label=${RUNNER_LABEL}=${deps.runnerId}`
|
|
618
619
|
]);
|
|
619
620
|
if (listed.status !== 0) throw failure(listed, "docker image ls");
|
|
620
621
|
const ids = [...new Set(listed.stdout.split("\n").map((l) => l.trim()).filter(Boolean))];
|
|
@@ -628,7 +629,7 @@ function createHousekeepingDocker(deps) {
|
|
|
628
629
|
}));
|
|
629
630
|
},
|
|
630
631
|
async listLabelledImages() {
|
|
631
|
-
const listed = await run("docker", ["image", "ls", "--all", "--no-trunc", "--quiet", "--filter", `label=${KIND_LABEL}`]);
|
|
632
|
+
const listed = await run("docker", ["image", "ls", "--all", "--no-trunc", "--quiet", "--filter", `label=${KIND_LABEL}`, "--filter", `label=${RUNNER_LABEL}=${deps.runnerId}`]);
|
|
632
633
|
if (listed.status !== 0) throw failure(listed, "docker image ls");
|
|
633
634
|
const ids = [...new Set(listed.stdout.split("\n").map((l) => l.trim()).filter(Boolean))];
|
|
634
635
|
if (ids.length === 0) return [];
|
|
@@ -668,6 +669,16 @@ function createHousekeepingDocker(deps) {
|
|
|
668
669
|
}
|
|
669
670
|
};
|
|
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
|
+
}
|
|
671
682
|
|
|
672
683
|
// src/runner/housekeeping/select.ts
|
|
673
684
|
var DAY_MS = 864e5;
|
|
@@ -821,11 +832,13 @@ async function runHousekeeping(options) {
|
|
|
821
832
|
const root = runnerDir(options.configPath);
|
|
822
833
|
let freed = 0;
|
|
823
834
|
let listed;
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
835
|
+
if (docker !== void 0) {
|
|
836
|
+
try {
|
|
837
|
+
const containers = await docker.listBuildContainers();
|
|
838
|
+
listed = { containers, volumes: await docker.listBuildVolumes() };
|
|
839
|
+
} catch (err) {
|
|
840
|
+
log.error(`housekeeping: Docker could not be asked, so nothing in Docker is removed this pass: ${describeCallFailure(err)}`);
|
|
841
|
+
}
|
|
829
842
|
}
|
|
830
843
|
const jobs = readJobs(jobsDir(options.configPath));
|
|
831
844
|
for (const name of jobs.unreadable) {
|
|
@@ -845,7 +858,7 @@ async function runHousekeeping(options) {
|
|
|
845
858
|
}
|
|
846
859
|
const live = liveBuildIds(jobs.unfinished);
|
|
847
860
|
const finished = finishedBuildIds(jobs.finished);
|
|
848
|
-
if (canTell && listed !== void 0) {
|
|
861
|
+
if (docker !== void 0 && canTell && listed !== void 0) {
|
|
849
862
|
for (const container of selectOrphans(listed.containers, live, finished)) {
|
|
850
863
|
try {
|
|
851
864
|
await docker.removeContainer(container.id);
|
|
@@ -863,7 +876,7 @@ async function runHousekeeping(options) {
|
|
|
863
876
|
}
|
|
864
877
|
}
|
|
865
878
|
}
|
|
866
|
-
if (canTell && listed !== void 0) {
|
|
879
|
+
if (docker !== void 0 && canTell && listed !== void 0) {
|
|
867
880
|
const recorded = recordedImages(options.configPath);
|
|
868
881
|
if (recorded === void 0) {
|
|
869
882
|
log.error("housekeeping: an image record does not parse, so no tagged image is removed this pass");
|
|
@@ -874,7 +887,7 @@ async function runHousekeeping(options) {
|
|
|
874
887
|
log.error(`housekeeping: the runner's images could not be listed: ${describeCallFailure(err)}`);
|
|
875
888
|
}
|
|
876
889
|
}
|
|
877
|
-
freed += await removeStaleRootDisks(root, jobs.unfinished, options);
|
|
890
|
+
freed += await removeStaleRootDisks(root, jobs.unfinished, options, docker);
|
|
878
891
|
try {
|
|
879
892
|
freed += await removeDanglingImages(docker, log, liveImageIds(jobs.unfinished));
|
|
880
893
|
} catch (err) {
|
|
@@ -924,7 +937,7 @@ async function runHousekeeping(options) {
|
|
|
924
937
|
log.line(`housekeeping: pass finished, freed ${formatBytes(freed)}`);
|
|
925
938
|
return { freedBytes: freed };
|
|
926
939
|
}
|
|
927
|
-
async function removeStaleRootDisks(root, unfinished, options) {
|
|
940
|
+
async function removeStaleRootDisks(root, unfinished, options, docker) {
|
|
928
941
|
const dir = rootfsDir(root);
|
|
929
942
|
const inUse = new Set(unfinished.flatMap((job) => job.microvm?.rootfs === void 0 ? [] : [job.microvm.rootfs]));
|
|
930
943
|
let freed = 0;
|
|
@@ -933,7 +946,7 @@ async function removeStaleRootDisks(root, unfinished, options) {
|
|
|
933
946
|
if (imageId === void 0) continue;
|
|
934
947
|
const path = join(dir, name);
|
|
935
948
|
if (inUse.has(path)) continue;
|
|
936
|
-
if (await
|
|
949
|
+
if (await docker.imageState(`sha256:${imageId}`) !== "missing") continue;
|
|
937
950
|
const size = sizeOf(path);
|
|
938
951
|
try {
|
|
939
952
|
rmSync(path, { force: true });
|
|
@@ -1813,13 +1826,16 @@ async function housekeepingPass(state) {
|
|
|
1813
1826
|
state.housekeepingRunning = true;
|
|
1814
1827
|
try {
|
|
1815
1828
|
state.deps.housekeeping ??= {};
|
|
1816
|
-
|
|
1829
|
+
const hostBuilder = keepsHostBuilder(state.config, state.deps.blocked?.builderDiskPinned);
|
|
1830
|
+
const names = { run: state.deps.housekeeping.run, runnerId: runnerLabelValue(state.config.configPath), builder: builderName(state.config.configPath) };
|
|
1831
|
+
const docker = state.deps.housekeeping.docker ?? (hostBuilder ? createHousekeepingDocker(names) : await housekeepingDockerIfReachable(names));
|
|
1832
|
+
if (hostBuilder) state.deps.housekeeping.docker ??= docker;
|
|
1817
1833
|
const result = await runHousekeeping({
|
|
1818
1834
|
configPath: state.config.configPath,
|
|
1819
1835
|
keepDays: config.jobsKeepDays,
|
|
1820
1836
|
buildCacheMax: config.buildCacheMax,
|
|
1821
|
-
removeHostBuilder: !
|
|
1822
|
-
docker
|
|
1837
|
+
removeHostBuilder: !hostBuilder,
|
|
1838
|
+
docker,
|
|
1823
1839
|
now: state.deps.now ?? (() => /* @__PURE__ */ new Date()),
|
|
1824
1840
|
log: logOf(state)
|
|
1825
1841
|
});
|
|
@@ -1905,7 +1921,7 @@ var CLAIM_REFUSAL_CODES = new Set(
|
|
|
1905
1921
|
"pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
|
|
1906
1922
|
);
|
|
1907
1923
|
async function tryClaimAndStart(state, item, queue) {
|
|
1908
|
-
const { postJson: postJson2 } = await import('./work-cmd-
|
|
1924
|
+
const { postJson: postJson2 } = await import('./work-cmd-3MKUIE2C.js');
|
|
1909
1925
|
const log = logOf(state);
|
|
1910
1926
|
const hostKey = await loadHostKey(state.config.configPath);
|
|
1911
1927
|
const claim = await retrySend(
|
|
@@ -3195,7 +3211,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3195
3211
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
3196
3212
|
const held = heldClaudeCredential();
|
|
3197
3213
|
const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
|
|
3198
|
-
return (await import('./check-
|
|
3214
|
+
return (await import('./check-QULEN437.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
3199
3215
|
},
|
|
3200
3216
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
3201
3217
|
log
|
|
@@ -3221,7 +3237,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3221
3237
|
check = "identity";
|
|
3222
3238
|
if (builtinKind(config.hooks.provision) === "container" || builtinKind(config.hooks.provision) === "vm") {
|
|
3223
3239
|
await ensureRunnerIdentity(configPath, {
|
|
3224
|
-
docker: deps.runnerIdentity ?? (deps.container?.host === void 0 ? void 0 : { holdsObjects: async () => false }),
|
|
3240
|
+
docker: deps.runnerIdentity ?? identityDockerFor({ keepsHostBuilder: keepsHostBuilder(config, deps.blocked?.builderDiskPinned) }) ?? (deps.container?.host === void 0 ? void 0 : { holdsObjects: async () => false }),
|
|
3225
3241
|
log: (line) => log.error(line)
|
|
3226
3242
|
}).catch((err) => log.error(`the runner's Docker identity could not be stored: ${describeCallFailure(err)} \xB7 using the names its folder's path gives`));
|
|
3227
3243
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { sanitizeTerminal } from './chunk-MECW77XP.js';
|
|
4
4
|
import { isAgentsMdLayout } from './chunk-NKOM4JKY.js';
|
|
5
|
-
import { resolveGatewayCredentials, defaultFetch } from './chunk-
|
|
5
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-3N77LUQI.js';
|
|
6
6
|
import { versionAtLeast } from './chunk-HCVLP7XA.js';
|
|
7
7
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
8
8
|
import { machineSkillsState, staleClaudeSkills } from './chunk-RCRE42V6.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { isSameProcess } from './chunk-JBJTC3UU.js';
|
|
4
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
4
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PXGU3GKY.js';
|
|
5
5
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
6
6
|
import { dirname } from 'path';
|
|
7
7
|
|
|
@@ -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-XBGHM7DB.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);
|