@outerlayer/cli 0.34.0-next.20261025132734 → 0.34.0-next.20261025180645
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 +6 -0
- package/dist/{agent-setup-HEJM3D3V.js → agent-setup-FNDKCPUP.js} +8 -9
- package/dist/{bridge-NBCXFTT4.js → bridge-YJBB4YA3.js} +2 -3
- package/dist/build-B4OKU4MV.js +16 -0
- package/dist/{build-disk-LEZ6LAM3.js → build-disk-ZL46AEN3.js} +7 -9
- package/dist/build-info.json +1 -1
- package/dist/{builder-I32JOQII.js → builder-XFPWE74N.js} +6 -8
- package/dist/{check-OOUGS65D.js → check-QULEN437.js} +45 -45
- package/dist/{chunk-65AKMFBH.js → chunk-25GRRBTH.js} +1 -1
- package/dist/{chunk-3CKMB2UK.js → chunk-2D6CKNR7.js} +8 -4
- package/dist/{chunk-5THSC6BD.js → chunk-2ILU7UAU.js} +1 -1
- package/dist/{chunk-5QBUX5YZ.js → chunk-3EJBI5JW.js} +3 -3
- package/dist/{chunk-6RKD7YZ6.js → chunk-3N77LUQI.js} +1 -1
- package/dist/{chunk-ES4ULBAL.js → chunk-4UPET3R7.js} +7 -3
- package/dist/{chunk-43I7PXDP.js → chunk-5AFPP3GZ.js} +239 -15
- package/dist/{chunk-HVRQQOMH.js → chunk-63IVRRIO.js} +3 -3
- package/dist/{chunk-FVKH3PMV.js → chunk-6OLVVAOK.js} +5 -5
- package/dist/{chunk-6ZFY2L2T.js → chunk-AJYZNISW.js} +416 -20
- package/dist/{chunk-6NUPXDAA.js → chunk-AVPLEFQR.js} +3 -3
- package/dist/{chunk-EN3YWO7Q.js → chunk-BHSSGVOY.js} +4 -4
- package/dist/{chunk-O6DYCIVW.js → chunk-CAQCDYKF.js} +2 -2
- package/dist/{chunk-7WM7K2DY.js → chunk-DNZYXEMY.js} +35 -21
- package/dist/{chunk-QMWUPRYQ.js → chunk-EGVHFHY4.js} +4 -4
- package/dist/{chunk-ACRRO3MB.js → chunk-FD5ASWTG.js} +22 -22
- package/dist/{chunk-57L2YAJA.js → chunk-FDJPDZSR.js} +1 -1
- package/dist/{chunk-EE2ZZGQV.js → chunk-FVCHHSHB.js} +3 -3
- package/dist/{chunk-BALIE3BA.js → chunk-G4W4B33M.js} +191 -8
- package/dist/{chunk-ZW6L275N.js → chunk-HHFZXOBC.js} +12 -14
- package/dist/{chunk-AMEM2ZLL.js → chunk-INOUUSYI.js} +29 -9
- package/dist/{chunk-XFFUXXI4.js → chunk-JBCOUY4M.js} +3 -3
- package/dist/{chunk-YEVPRO7L.js → chunk-JQSZTQSK.js} +81 -52
- package/dist/{chunk-TDAQHYM4.js → chunk-K2UAQWYO.js} +3 -3
- package/dist/{chunk-ZYKFYNES.js → chunk-KM2HLQE3.js} +2 -2
- package/dist/{chunk-DXJTBU7A.js → chunk-LUHIN4UZ.js} +3 -3
- package/dist/{chunk-SOI6K5DY.js → chunk-MOI2KDLH.js} +1 -1
- package/dist/{chunk-QDVGOMSC.js → chunk-NW26E4YU.js} +3 -3
- package/dist/{chunk-YIBFGAYI.js → chunk-O4Z2MNNL.js} +6 -6
- package/dist/{chunk-L26V6ILJ.js → chunk-OGPEHSNW.js} +1 -1
- package/dist/{chunk-2JB4GD34.js → chunk-OQLF3MQQ.js} +3 -4
- package/dist/{chunk-Z5IW4DHH.js → chunk-OS7DJOQJ.js} +1 -1
- package/dist/{chunk-DA3PLB5N.js → chunk-PAK5P2ND.js} +1 -1
- package/dist/{chunk-3IH6K7KG.js → chunk-PFHTT4PP.js} +5 -5
- package/dist/{chunk-PA6CK6WQ.js → chunk-PXGU3GKY.js} +1 -1
- package/dist/{chunk-YGSY2NWU.js → chunk-QANM5COC.js} +6 -6
- package/dist/{chunk-K5Q6T7SE.js → chunk-QQP3S5FU.js} +3 -3
- package/dist/{chunk-62LXQM7U.js → chunk-RFVIQLNB.js} +5 -5
- package/dist/{chunk-E4ASIOVL.js → chunk-RHV5SRI2.js} +3 -3
- package/dist/{chunk-6LBSAW6I.js → chunk-SI6WDF3U.js} +1 -1
- package/dist/chunk-SUOZYOWO.js +51 -0
- package/dist/{chunk-MZBQTVFG.js → chunk-SYVRBBLW.js} +1 -1
- package/dist/{chunk-5HZGLLNW.js → chunk-TBKV4L2W.js} +5 -5
- package/dist/{chunk-GH246BGV.js → chunk-TFPNPS4Q.js} +1 -1
- package/dist/{chunk-NBZ7XBT6.js → chunk-UMYYYF7B.js} +1 -1
- package/dist/{chunk-Z4KWHSO4.js → chunk-UN3SQTVL.js} +7 -7
- package/dist/{chunk-ZVLSYWDF.js → chunk-UO4FQAOX.js} +16 -12
- package/dist/{chunk-4Y54SQXH.js → chunk-VJ34F55N.js} +105 -44
- package/dist/{chunk-272AKVRP.js → chunk-YHKU2NOZ.js} +1 -1
- package/dist/{chunk-F5UL23I2.js → chunk-YNMVVQOQ.js} +1 -1
- package/dist/{claude-launcher-MORG66PJ.js → claude-launcher-OQZNW7XJ.js} +1 -1
- package/dist/{cli-XI7RUSC5.js → cli-G3P2B2XE.js} +124 -118
- package/dist/{command-BJSHY6OB.js → command-4XOXVWFW.js} +169 -48
- package/dist/config-QASNKYM6.js +16 -0
- package/dist/{connect-cmd-YAUOCX4X.js → connect-cmd-MEDWMW3L.js} +8 -9
- package/dist/{container-start-QADK3YGL.js → container-start-2DHCWV73.js} +34 -36
- package/dist/{context-show-cmd-VHY3OBIA.js → context-show-cmd-VSFCG663.js} +9 -10
- package/dist/{control-plane-launch-QSBWTA2V.js → control-plane-launch-XBGHM7DB.js} +5 -6
- package/dist/{dist-ZAHCXYSG.js → dist-QGN5R4Y2.js} +1 -1
- package/dist/{docker-DJ73SZRC.js → docker-TAC6G4VU.js} +6 -8
- package/dist/{doctor-UR76MCGI.js → doctor-LK6E3XOW.js} +68 -43
- package/dist/{emit-artifact-cmd-DP2EQ54N.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-TTFBN6RK.js → emit-criteria-cmd-QVFOQARC.js} +10 -11
- package/dist/{emit-demo-cmd-Z7YGLEBJ.js → emit-demo-cmd-L4B6OOTV.js} +15 -16
- package/dist/{emit-finding-cmd-IQRD3J2X.js → emit-finding-cmd-YXFCIWMU.js} +10 -11
- package/dist/{emit-result-cmd-GIWB6UHH.js → emit-result-cmd-NI4LCTUM.js} +12 -13
- package/dist/{emit-step-cmd-PU5TTU6C.js → emit-step-cmd-HWAUCZZB.js} +10 -11
- package/dist/{exec-client-7PT4W7JR.js → exec-client-QB4OZRGM.js} +3 -4
- package/dist/find-unit-4UR647S4.js +18 -0
- package/dist/{findings-cmd-7J5SHCUO.js → findings-cmd-O2IBO25E.js} +10 -11
- package/dist/{fleet-readiness-G63D76EX.js → fleet-readiness-NJYTQYTA.js} +5 -6
- package/dist/{governing-source-DLESDP6T.js → governing-source-JCI7VDQ6.js} +12 -13
- package/dist/{guest-init-J3F3AEEY.js → guest-init-IF5LXGUL.js} +4 -5
- package/dist/{hook-fast-VQXRDS6E.js → hook-fast-GPUL7T77.js} +1 -1
- package/dist/host-key-5RU322O3.js +9 -0
- package/dist/{image-tag-ADSLWXBA.js → image-tag-SEMBVB5D.js} +3 -4
- package/dist/index.js +4 -4
- package/dist/{init-KSXU4PA7.js → init-2CEULE3F.js} +25 -27
- package/dist/{init-67R7LO4C.js → init-FAIF7KOK.js} +25 -27
- package/dist/{init-cmd-MNOVMADM.js → init-cmd-HZUUMO45.js} +13 -14
- package/dist/{init-update-6KEXRCJH.js → init-update-TTMFFNMB.js} +12 -13
- package/dist/{install-cmd-FV7IZ7XF.js → install-cmd-TWGRGEVL.js} +5 -6
- package/dist/{logs-HI46FO6Z.js → logs-6CMB3DO6.js} +2 -3
- package/dist/{loop-KUEOPBKX.js → loop-7U7MVICV.js} +41 -43
- package/dist/{machine-EQEAPT76.js → machine-S3JHOX4V.js} +25 -27
- package/dist/{mcp-serve-cmd-7ABBV2QE.js → mcp-serve-cmd-MWGIN6YL.js} +4 -5
- package/dist/{paths-7HVTDE6J.js → paths-T2DEBI62.js} +2 -3
- package/dist/pending-ERXWVLLG.js +9 -0
- package/dist/{pidfile-5UDLYPMC.js → pidfile-EAD2OEM7.js} +3 -4
- package/dist/{record-PPZEXAVA.js → record-IMXQNHPB.js} +3 -4
- package/dist/runner-env-BJPUHAKZ.js +18 -0
- package/dist/runner-identity-ZCPPC2BJ.js +13 -0
- package/dist/{runner-key-ML7R33HF.js → runner-key-CYSUYKSX.js} +25 -27
- package/dist/{session-sender-A43GZQ7T.js → session-sender-5T7BXPKC.js} +13 -14
- package/dist/{spec-cmd-VVUJZSG2.js → spec-cmd-4ABYAFNZ.js} +11 -12
- package/dist/{status-4G6K7I2C.js → status-2AP7J2L7.js} +32 -34
- package/dist/{sync-cmd-ZEC65ABJ.js → sync-cmd-34CGNA6T.js} +12 -13
- package/dist/{update-steps-XLO7734I.js → update-steps-JQOCCDWO.js} +33 -35
- package/dist/{watch-QB4AMWR3.js → watch-6HU7LCUY.js} +12 -13
- package/dist/{work-claim-cmd-6W3GBHRS.js → work-claim-cmd-5QKLHSCR.js} +17 -19
- package/dist/{work-cmd-LTZXOPPN.js → work-cmd-3MKUIE2C.js} +10 -11
- package/dist/{work-comment-cmd-LDZBUO6M.js → work-comment-cmd-ESC3DSHI.js} +11 -12
- package/dist/{work-demo-cmd-77LISWQ3.js → work-demo-cmd-7S23DGYO.js} +10 -11
- package/dist/{work-logs-cmd-FK7HE7PC.js → work-logs-cmd-46UPNN7Q.js} +10 -11
- package/dist/{work-open-pr-cmd-WVONEHZL.js → work-open-pr-cmd-JNGTGLIP.js} +11 -12
- package/dist/{work-pr-cmd-6IPXWJEH.js → work-pr-cmd-2J2LKETD.js} +10 -11
- package/dist/{work-proofs-cmd-TGIAP5IO.js → work-proofs-cmd-HRWTHYSS.js} +11 -12
- package/dist/{work-proofs-record-XPAU7N57.js → work-proofs-record-6OKAT3IC.js} +18 -19
- package/dist/{work-stop-cmd-UJ45EV3A.js → work-stop-cmd-Y22XIVQ6.js} +10 -11
- package/package.json +1 -1
- package/dist/build-LSU25G3M.js +0 -14
- package/dist/chunk-3Z3MPR55.js +0 -226
- package/dist/chunk-HACGUL52.js +0 -183
- package/dist/config-WRHQDGVI.js +0 -18
- package/dist/host-key-UERIQRE6.js +0 -10
- package/dist/inspect-DNLXTXLA.js +0 -6
- package/dist/install-OCBERTPQ.js +0 -19
- package/dist/pending-5HZACM2V.js +0 -10
- package/dist/runner-env-L7OPH3O3.js +0 -20
- package/dist/runner-identity-VASV2AEQ.js +0 -15
- package/dist/{chunk-2AIOOU3A.js → chunk-KPHRRCUY.js} +1 -1
|
@@ -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-PXGU3GKY.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,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-6ZFY2L2T.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-PA6CK6WQ.js';
|
|
8
|
-
import { PROXY_WARNING_FLAG, withGitConfig, tokenHeader } from './chunk-BALIE3BA.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-YIBFGAYI.js';
|
|
5
10
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
10
|
-
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-57L2YAJA.js';
|
|
11
|
-
import { RUNNER_PROTOCOL } from './chunk-DA3PLB5N.js';
|
|
12
|
-
import { realBlockedProbes, checkBlockedWithSlots, keepsHostBuilder } from './chunk-7WM7K2DY.js';
|
|
13
|
-
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-NBZ7XBT6.js';
|
|
11
|
+
import { RUNNER_PROTOCOL } from './chunk-PAK5P2ND.js';
|
|
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, 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-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-62LXQM7U.js';
|
|
19
|
-
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-MZBQTVFG.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
|
});
|
|
@@ -1881,7 +1897,7 @@ async function runTick(state) {
|
|
|
1881
1897
|
claimed = true;
|
|
1882
1898
|
break;
|
|
1883
1899
|
}
|
|
1884
|
-
if (attempt.kind === "outdated" || attempt.kind === "read_only" || attempt.kind === "signature" || attempt.kind === "no_item_key" || attempt.kind === "no_branch" || attempt.kind === "unreadable_repositories") {
|
|
1900
|
+
if (attempt.kind === "outdated" || attempt.kind === "read_only" || attempt.kind === "managed_refused" || attempt.kind === "signature" || attempt.kind === "no_item_key" || attempt.kind === "no_branch" || attempt.kind === "unreadable_repositories") {
|
|
1885
1901
|
return;
|
|
1886
1902
|
}
|
|
1887
1903
|
if (attempt.kind === "error") {
|
|
@@ -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(
|
|
@@ -1942,6 +1958,10 @@ async function tryClaimAndStart(state, item, queue) {
|
|
|
1942
1958
|
reportRepeating(state, "the request signature", claim.message ?? claim.reason);
|
|
1943
1959
|
return { kind: "signature" };
|
|
1944
1960
|
}
|
|
1961
|
+
if (claim.code === "managed_credential_missing" || claim.code === "managed_builds_off") {
|
|
1962
|
+
reportRepeating(state, "the managed build", claim.message ?? claim.reason);
|
|
1963
|
+
return { kind: "managed_refused" };
|
|
1964
|
+
}
|
|
1945
1965
|
if (claim.code === "billing_read_only") {
|
|
1946
1966
|
reportRepeating(state, "the organization's billing", claim.message ?? claim.reason);
|
|
1947
1967
|
return { kind: "read_only" };
|
|
@@ -1970,6 +1990,7 @@ async function tryClaimAndStart(state, item, queue) {
|
|
|
1970
1990
|
return { kind: "error", reason: `${claim.reason} (${claim.attempts} attempt(s))` };
|
|
1971
1991
|
}
|
|
1972
1992
|
reportRepeating(state, "the organization's billing", void 0);
|
|
1993
|
+
reportRepeating(state, "the managed build", void 0);
|
|
1973
1994
|
reportRepeating(state, "the runner protocol", void 0);
|
|
1974
1995
|
state.upgradeRefused = false;
|
|
1975
1996
|
state.versionRefusalLogged = void 0;
|
|
@@ -2120,6 +2141,15 @@ async function startJob(state, item, queue, claimId, itemKey, branch, identity,
|
|
|
2120
2141
|
return;
|
|
2121
2142
|
}
|
|
2122
2143
|
if (active.ending) return;
|
|
2144
|
+
if (state.config.managed === true) {
|
|
2145
|
+
const fetched = await fetchManagedClaudeKey(state.config, item.number, { fetchImpl: state.deps.fetchImpl, now: state.deps.now, sleep: state.deps.sleep });
|
|
2146
|
+
if (active.ending) return;
|
|
2147
|
+
if (!fetched.ok) {
|
|
2148
|
+
await endOnManagedKeyRefusal(state, active, fetched);
|
|
2149
|
+
return;
|
|
2150
|
+
}
|
|
2151
|
+
holdManagedClaudeKey(dirPath, fetched.apiKey);
|
|
2152
|
+
}
|
|
2123
2153
|
}
|
|
2124
2154
|
if (state.config.hooks.report) {
|
|
2125
2155
|
setStage(job, dirPath, "report");
|
|
@@ -2532,6 +2562,21 @@ function buildTokensFor(state, active, item) {
|
|
|
2532
2562
|
}
|
|
2533
2563
|
});
|
|
2534
2564
|
}
|
|
2565
|
+
async function endOnManagedKeyRefusal(state, active, refused) {
|
|
2566
|
+
const log = logOf(state);
|
|
2567
|
+
const tag = `#${active.job.item}`;
|
|
2568
|
+
const code = refused.code ?? "unavailable";
|
|
2569
|
+
if (refused.code === "claim_expired" || refused.code === "claim_not_held") {
|
|
2570
|
+
log.error(`${tag} the build's Anthropic key was refused: ${code} \xB7 ending job as lease_lost`);
|
|
2571
|
+
await endJob(state, active, "lease_lost");
|
|
2572
|
+
} else if (refused.retryable || refused.code === "managed_credential_missing" || refused.code === "managed_builds_off") {
|
|
2573
|
+
log.error(`${tag} the build's Anthropic key could not be had (${code}) \xB7 releasing the claim to try again`);
|
|
2574
|
+
await endJob(state, active, void 0);
|
|
2575
|
+
} else {
|
|
2576
|
+
log.error(`${tag} the build's Anthropic key was refused: ${code} \xB7 ending job as failed`);
|
|
2577
|
+
await endJob(state, active, "failed", { stage: "provision", reason: code });
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2535
2580
|
async function endOnTokenRefusal(state, active, err, repository) {
|
|
2536
2581
|
const log = logOf(state);
|
|
2537
2582
|
const tag = `#${active.job.item}`;
|
|
@@ -2963,6 +3008,21 @@ async function rejoinMicroVmBuild(state, adopted) {
|
|
|
2963
3008
|
const fd = inherited.get(fdName(microvm.buildId, socket.replace(/\.sock$/, "")));
|
|
2964
3009
|
return fd === void 0 ? void 0 : (server) => runtime.vm.fdStore.listenOn(server, fd);
|
|
2965
3010
|
};
|
|
3011
|
+
if (config.managed === true) {
|
|
3012
|
+
const fetched = await fetchManagedClaudeKey(config, job.item, {
|
|
3013
|
+
fetchImpl: state.deps.fetchImpl,
|
|
3014
|
+
now: state.deps.now,
|
|
3015
|
+
sleep: state.deps.sleep,
|
|
3016
|
+
windowMs: ADOPTED_FETCH_RETRY_WINDOW_MS
|
|
3017
|
+
});
|
|
3018
|
+
if (!fetched.ok) {
|
|
3019
|
+
const code = fetched.code ?? "unavailable";
|
|
3020
|
+
log.error(`${tag} the adopted build's Anthropic key could not be had: ${code}`);
|
|
3021
|
+
const cause = fetched.retryable ? "the gateway could not be reached for it" : `the gateway refused it (${code})`;
|
|
3022
|
+
return { reason: `the adopted build's Anthropic key could not be had after the runner restarted: ${cause}`, why: "the gateway did not give its Anthropic key again" };
|
|
3023
|
+
}
|
|
3024
|
+
holdManagedClaudeKey(dirPath, fetched.apiKey);
|
|
3025
|
+
}
|
|
2966
3026
|
const tokens = buildTokensFor(state, adopted, job.item);
|
|
2967
3027
|
runtime.credentials.set(dirPath, tokens);
|
|
2968
3028
|
let servicesServed = false;
|
|
@@ -2995,7 +3055,7 @@ async function rejoinMicroVmBuild(state, adopted) {
|
|
|
2995
3055
|
}).catch((err) => log.error(`${tag} the read token could not be written for gh in the guest: ${describeCallFailure(err)}`));
|
|
2996
3056
|
});
|
|
2997
3057
|
await pushes;
|
|
2998
|
-
return servicesServed && leaseServed;
|
|
3058
|
+
return servicesServed && leaseServed ? true : { reason: MICROVM_SOCKETS_LOST_REASON, why: "the sockets it reaches the runner on could not be served again" };
|
|
2999
3059
|
}
|
|
3000
3060
|
async function adoptTrackedMicroVms(state, plan) {
|
|
3001
3061
|
const log = logOf(state);
|
|
@@ -3008,9 +3068,10 @@ async function adoptTrackedMicroVms(state, plan) {
|
|
|
3008
3068
|
const adopted = { job, dirPath, lastRenewAtMs: 0, cmd: null, cpuSample: null, ending: false };
|
|
3009
3069
|
state.jobs.set(dirPath, adopted);
|
|
3010
3070
|
attemptLogs.open(job.item, dirPath);
|
|
3011
|
-
|
|
3071
|
+
const rejoined = await rejoinMicroVmBuild(state, adopted);
|
|
3072
|
+
if (rejoined !== true) {
|
|
3012
3073
|
state.jobs.delete(dirPath);
|
|
3013
|
-
await finishMicroVmWhileAway(state, dirPath, job,
|
|
3074
|
+
await finishMicroVmWhileAway(state, dirPath, job, rejoined.reason, rejoined.why);
|
|
3014
3075
|
continue;
|
|
3015
3076
|
}
|
|
3016
3077
|
if (!await renewLeaseIfDue(state, adopted, nowOf(state).getTime())) continue;
|
|
@@ -3150,7 +3211,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3150
3211
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
3151
3212
|
const held = heldClaudeCredential();
|
|
3152
3213
|
const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
|
|
3153
|
-
return (await import('./check-
|
|
3214
|
+
return (await import('./check-QULEN437.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
3154
3215
|
},
|
|
3155
3216
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
3156
3217
|
log
|
|
@@ -3176,7 +3237,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3176
3237
|
check = "identity";
|
|
3177
3238
|
if (builtinKind(config.hooks.provision) === "container" || builtinKind(config.hooks.provision) === "vm") {
|
|
3178
3239
|
await ensureRunnerIdentity(configPath, {
|
|
3179
|
-
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 }),
|
|
3180
3241
|
log: (line) => log.error(line)
|
|
3181
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`));
|
|
3182
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);
|