@outerlayer/cli 0.26.3 → 0.27.0
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/CHANGELOG.md +25 -0
- package/README.md +12 -9
- package/dist/{agent-setup-PZYQWN4H.js → agent-setup-UW36TAQM.js} +13 -13
- package/dist/{bridge-5KZ36YDG.js → bridge-B5VJVECY.js} +2 -2
- package/dist/build-TNM7HYCA.js +12 -0
- package/dist/build-info.json +1 -1
- package/dist/{builder-WEGLC2F2.js → builder-LDJGS2JC.js} +6 -6
- package/dist/{check-WJJ325EQ.js → check-JVBAWIN6.js} +44 -43
- package/dist/{chunk-7LVF4E5V.js → chunk-24ID7EQ2.js} +7 -4
- package/dist/{chunk-HXFRJKMU.js → chunk-2F762IXY.js} +2 -2
- package/dist/{chunk-2K3TCQHW.js → chunk-2I3LIRZP.js} +26 -8
- package/dist/{chunk-UKCNOAO6.js → chunk-55GNQPO6.js} +17 -6
- package/dist/{chunk-XSPA5ODY.js → chunk-6BLXUD56.js} +4 -3
- package/dist/{chunk-MWPBF2XG.js → chunk-6KKM7VGZ.js} +32 -4
- package/dist/{chunk-VPEGE3QZ.js → chunk-6TRNCUM4.js} +1 -1
- package/dist/{chunk-MLD2NA7N.js → chunk-7AQ5AM7U.js} +12 -5
- package/dist/{chunk-HBISTTG3.js → chunk-7OUOLGUV.js} +20 -5
- package/dist/{chunk-6FAP657M.js → chunk-ABXQBEYK.js} +1 -1
- package/dist/{chunk-TSW4DGV2.js → chunk-B6K7R5UY.js} +2 -2
- package/dist/chunk-BM7EC3OZ.js +181 -0
- package/dist/{chunk-W3NVHOCS.js → chunk-BPKO76QR.js} +4 -4
- package/dist/{chunk-QRZLUUNN.js → chunk-BWH36FOC.js} +8 -3
- package/dist/{chunk-PYSKSROG.js → chunk-D7ECMB7B.js} +4 -4
- package/dist/{chunk-FO7F6QSV.js → chunk-DJHNEGNM.js} +27 -3
- package/dist/{chunk-TPAF24PK.js → chunk-E5IJ5533.js} +2 -2
- package/dist/{chunk-JWRX5ZTT.js → chunk-EPPIISRD.js} +2 -2
- package/dist/{chunk-6M4LNO22.js → chunk-FP23SVDD.js} +6 -6
- package/dist/{chunk-GOSFARMS.js → chunk-G2JWZDFA.js} +9 -2
- package/dist/{chunk-XFGL53GU.js → chunk-G3EZA6MK.js} +56 -8
- package/dist/{chunk-5PMQDQFV.js → chunk-GFUE5TKO.js} +3 -3
- package/dist/{chunk-XLC7KEUV.js → chunk-GLUKDQS4.js} +1 -1
- package/dist/{chunk-ZLEXMZFW.js → chunk-JH2GQU5T.js} +5 -5
- package/dist/{chunk-YVZJ6GKF.js → chunk-KT4CN6OU.js} +1 -1
- package/dist/{chunk-JKNYTNYD.js → chunk-LOKSLO25.js} +1 -1
- package/dist/{chunk-665QWBNW.js → chunk-M3MHHIUW.js} +1 -1
- package/dist/{chunk-4IFKLYMM.js → chunk-MATUHHN4.js} +1 -1
- package/dist/{chunk-MQ743JX3.js → chunk-MHX7YX7Y.js} +1 -1
- package/dist/{chunk-TEVO3RUV.js → chunk-N4D5TMVU.js} +4 -4
- package/dist/{chunk-EORWWFPA.js → chunk-O2IJTY7L.js} +2 -2
- package/dist/{chunk-EABW6AJQ.js → chunk-PJDQPF5N.js} +18 -5
- package/dist/{chunk-KDDFI5MR.js → chunk-QHH4OSD4.js} +1 -1
- package/dist/{chunk-W7LGHNXT.js → chunk-QIVOTQOQ.js} +5 -5
- package/dist/{chunk-JF572PM5.js → chunk-QKIQ2R7F.js} +3 -3
- package/dist/{chunk-L4CW6LZQ.js → chunk-RHAGBUL5.js} +5 -2
- package/dist/{chunk-TKL74NLB.js → chunk-RHGF73IU.js} +1 -1
- package/dist/{chunk-SKZG7SAN.js → chunk-RK7FWC6B.js} +206 -42
- package/dist/{chunk-6MZSX4M7.js → chunk-STSLH5EJ.js} +3 -1
- package/dist/{chunk-K7FCZCLQ.js → chunk-TXHJ7BGR.js} +13 -13
- package/dist/{chunk-364XDGOK.js → chunk-UQYBCJ2L.js} +3 -3
- package/dist/{chunk-2AKDF6C2.js → chunk-VS27BP3E.js} +5 -5
- package/dist/{chunk-J7BXZLSO.js → chunk-WSYXLLA5.js} +29 -8
- package/dist/{chunk-WX2WEERU.js → chunk-WUL2OP5A.js} +3 -3
- package/dist/{chunk-ZPXI7LMG.js → chunk-WVDP6HVZ.js} +6 -6
- package/dist/{chunk-MXTN35XN.js → chunk-XBPUTQ7E.js} +1 -1
- package/dist/{chunk-UNF7MWEL.js → chunk-XS3FDWSZ.js} +1 -1
- package/dist/{chunk-VJBFQP3H.js → chunk-XZ6Q6ZNR.js} +9 -5
- package/dist/{chunk-F6DIHHBS.js → chunk-Y4OKEFAX.js} +1 -1
- package/dist/{chunk-XDHYZWEK.js → chunk-Y7ZCHBYB.js} +2 -2
- package/dist/chunk-YB3CSYXX.js +95 -0
- package/dist/{chunk-VHVFU6QU.js → chunk-YF56R4DV.js} +86 -31
- package/dist/chunk-YJLHUKYS.js +38 -0
- package/dist/{chunk-XF77SNB4.js → chunk-ZXRWMOJ3.js} +287 -51
- package/dist/{claude-launcher-O2U6P6ZD.js → claude-launcher-TKX4WCUN.js} +8 -4
- package/dist/{cli-2UUJM3AE.js → cli-XVXQDKZT.js} +141 -135
- package/dist/{command-GQBHC53U.js → command-B2T7VR77.js} +33 -32
- package/dist/{config-JJ3EO7SB.js → config-TWS5VZEN.js} +3 -3
- package/dist/{connect-cmd-2JHSLBXK.js → connect-cmd-HGS7YPA2.js} +10 -10
- package/dist/{container-start-AUJHF2BC.js → container-start-JE7HTKZG.js} +32 -31
- package/dist/{control-plane-launch-654RV5PO.js → control-plane-launch-DBQA3KLJ.js} +9 -9
- package/dist/{docker-NYAIIX2F.js → docker-MJEEHUUA.js} +6 -6
- package/dist/{doctor-NV2PUERZ.js → doctor-6ZIF2BRZ.js} +184 -37
- package/dist/{emit-artifact-cmd-XXTCHP6V.js → emit-artifact-cmd-ALDK55Y2.js} +14 -14
- package/dist/{emit-cmd-WQH2NK7H.js → emit-cmd-VAQHRWJR.js} +4 -4
- package/dist/{emit-criteria-cmd-VMZIRJCQ.js → emit-criteria-cmd-Q7SM6VP2.js} +11 -11
- package/dist/{emit-finding-cmd-KMJNYQI7.js → emit-finding-cmd-2NBAPDSV.js} +11 -11
- package/dist/{emit-result-cmd-HRTXGZLK.js → emit-result-cmd-KUSL56RI.js} +14 -14
- package/dist/{emit-step-cmd-AUHA3EXY.js → emit-step-cmd-KD4AKEAT.js} +12 -12
- package/dist/{exec-client-J6L5FDRR.js → exec-client-6WVS7DRZ.js} +3 -3
- package/dist/{governing-source-PTJ6EAA3.js → governing-source-VVUA5TKB.js} +16 -16
- package/dist/{guest-init-CXIHA5VI.js → guest-init-H5K2RW3P.js} +4 -4
- package/dist/{hook-fast-SDFXJEAW.js → hook-fast-3SUJM765.js} +1 -1
- package/dist/{host-key-5TKBNUZ4.js → host-key-XNKZCWTS.js} +3 -3
- package/dist/{image-tag-5SJ6ZKT7.js → image-tag-R34J4O3F.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/init-ETKGFCXR.js +55 -0
- package/dist/{init-UZWRJMPZ.js → init-Q2RPUUVP.js} +33 -32
- package/dist/{init-cmd-SQKWPACS.js → init-cmd-M6MQRGOU.js} +19 -18
- package/dist/{init-update-FJDKY4SJ.js → init-update-N4HTZGVS.js} +59 -30
- package/dist/{inspect-6UYAAXH7.js → inspect-IPFA7AAT.js} +1 -1
- package/dist/{install-QSTTBUHX.js → install-6OIY3KHZ.js} +6 -5
- package/dist/{install-cmd-3DXJJUAA.js → install-cmd-JMT67P35.js} +5 -5
- package/dist/{layout-UOJQGEPW.js → layout-XNFDTOET.js} +2 -2
- package/dist/{login-browser-4OMZFP3U.js → login-browser-EWXSGHM7.js} +3 -3
- package/dist/{logout-cmd-5V5MMBSY.js → logout-cmd-5WE2N5B5.js} +2 -2
- package/dist/{logs-VN2HKDSH.js → logs-XHAS6LMZ.js} +2 -2
- package/dist/loop-2Y4CUFNP.js +79 -0
- package/dist/machine-Z2S47JW7.js +50 -0
- package/dist/machine-skills-RRF4HLAD.js +11 -0
- package/dist/{mcp-install-cmd-GGWB3JJ2.js → mcp-install-cmd-LD7KYAOP.js} +2 -2
- package/dist/{mcp-serve-cmd-U5N5DK3H.js → mcp-serve-cmd-LY5A3CE7.js} +5 -5
- package/dist/{paths-ZC6BMWMT.js → paths-LHSPNORF.js} +2 -2
- package/dist/{pending-54HC7MM3.js → pending-3YZCSKON.js} +3 -3
- package/dist/{pidfile-BY5Z6YH7.js → pidfile-DKMYYXLH.js} +3 -3
- package/dist/{record-K23IN6QN.js → record-3LPTY3G5.js} +3 -3
- package/dist/{runner-env-2D7MPOIJ.js → runner-env-YRRNRKF4.js} +8 -7
- package/dist/{runner-identity-YYENYKDH.js → runner-identity-EX7HXPUE.js} +6 -6
- package/dist/{runner-key-AZVXBQIB.js → runner-key-GO277GW2.js} +32 -31
- package/dist/{session-sender-VH2EKAT5.js → session-sender-SC5PSU2G.js} +15 -15
- package/dist/{spec-cmd-BOUPLX7X.js → spec-cmd-JGYHHJ4P.js} +12 -12
- package/dist/{starter-pack-55EFILC5.js → starter-pack-GPU4X6B7.js} +2 -2
- package/dist/{status-3WC2IGVI.js → status-CJCE2FHD.js} +34 -33
- package/dist/{sync-cmd-GT2WTQRA.js → sync-cmd-ATXJVS7S.js} +14 -14
- package/dist/{watch-JED7SYAA.js → watch-M7NR3DOW.js} +14 -14
- package/dist/{work-claim-cmd-MY4N74HA.js → work-claim-cmd-DNUDZKJA.js} +16 -16
- package/dist/{work-cmd-UQ45HDM4.js → work-cmd-VECTYST6.js} +12 -12
- package/dist/{work-comment-cmd-I7NNSNDP.js → work-comment-cmd-F3NRWKPZ.js} +12 -12
- package/dist/{work-logs-cmd-YIQJVENH.js → work-logs-cmd-QF6P32FE.js} +12 -12
- package/dist/{work-open-pr-cmd-VP5NNTCW.js → work-open-pr-cmd-XE23JA3R.js} +13 -13
- package/dist/{work-pr-cmd-DKTBEFHO.js → work-pr-cmd-BH56GUKN.js} +12 -12
- package/dist/{work-stop-cmd-GN2WX73C.js → work-stop-cmd-C3F5HNUO.js} +12 -12
- package/package.json +1 -1
- package/skill-pack/maintained/outerlayer-cli/SKILL.md +6 -5
- package/skill-pack/shipped.json +1 -0
- package/skill-pack/template/build/SKILL.md +1 -1
- package/dist/build-EBQYXL7Y.js +0 -12
- package/dist/chunk-7RQ73DLO.js +0 -23
- package/dist/init-KIGYMLDM.js +0 -54
- package/dist/loop-OE32U2IZ.js +0 -78
- package/dist/machine-L7INJ4JN.js +0 -49
|
@@ -1,48 +1,50 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
4
|
-
import { senderPidfile } from './chunk-
|
|
5
|
-
import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-
|
|
6
|
-
import { writeDockerClientConfig } from './chunk-
|
|
7
|
-
import { installScrubContext } from './chunk-
|
|
8
|
-
import { ADDED_USER, AssetError, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, resolveAgentUser, AgentUserError, runBuildSteps,
|
|
9
|
-
import {
|
|
4
|
+
import { senderPidfile } from './chunk-Y7ZCHBYB.js';
|
|
5
|
+
import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-6KKM7VGZ.js';
|
|
6
|
+
import { writeDockerClientConfig } from './chunk-XS3FDWSZ.js';
|
|
7
|
+
import { installScrubContext } from './chunk-VS27BP3E.js';
|
|
8
|
+
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, AssetError, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, resolveAgentUser, AgentUserError, runBuildSteps, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, containerSenderCommand, signalInContainer, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, helperFirecrackerNote, HelperRefusal, isLiteralAddress, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, copyJudgeTree } from './chunk-YF56R4DV.js';
|
|
9
|
+
import { describeCallFailure, resolveGoverningSource, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, keptContextTree } from './chunk-WSYXLLA5.js';
|
|
10
|
+
import { fdName } from './chunk-YB3CSYXX.js';
|
|
11
|
+
import { readBranchHead, fetchCommit, diffBetween } from './chunk-24ID7EQ2.js';
|
|
10
12
|
import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
|
|
11
|
-
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile,
|
|
12
|
-
import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-
|
|
13
|
-
import { waitForAgent, vmExecArgs } from './chunk-
|
|
14
|
-
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-
|
|
15
|
-
import {
|
|
16
|
-
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-UKCNOAO6.js';
|
|
13
|
+
import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, childEnvironment, judgeCommand, JUDGE_MAX_TURNS, MAX_REPORT_BYTES, JUDGE_DIR, COMMAND_DIR } from './chunk-JH2GQU5T.js';
|
|
14
|
+
import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-B6K7R5UY.js';
|
|
15
|
+
import { waitForAgent, vmExecArgs } from './chunk-XBPUTQ7E.js';
|
|
16
|
+
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-GLUKDQS4.js';
|
|
17
|
+
import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-55GNQPO6.js';
|
|
17
18
|
import { planArtifactUpload } from './chunk-BUP5N3X6.js';
|
|
18
|
-
import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-
|
|
19
|
-
import { parseSize } from './chunk-
|
|
19
|
+
import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-EPPIISRD.js';
|
|
20
|
+
import { parseSize } from './chunk-YJLHUKYS.js';
|
|
21
|
+
import { resolvePackRoot, MAINTAINED_SKILLS } from './chunk-7OUOLGUV.js';
|
|
20
22
|
import { scrubText } from './chunk-QE3UQAHK.js';
|
|
21
|
-
import { readCloudConfig } from './chunk-
|
|
22
|
-
import { resolvePackRoot } from './chunk-HBISTTG3.js';
|
|
23
|
+
import { readCloudConfig } from './chunk-PJDQPF5N.js';
|
|
23
24
|
import { parsePolicy } from './chunk-RKOTJQVG.js';
|
|
24
25
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
25
26
|
import { resolveVersion } from './chunk-RA3O54FC.js';
|
|
26
|
-
import { signerFor } from './chunk-
|
|
27
|
-
import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath } from './chunk-
|
|
28
|
-
import { claudeCredential, repositoriesOf, primaryOf, buildEnvironment,
|
|
27
|
+
import { signerFor } from './chunk-Y4OKEFAX.js';
|
|
28
|
+
import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath } from './chunk-RHAGBUL5.js';
|
|
29
|
+
import { JOB_MOUNT, claudeCredential, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, checkEnvironment, EVAL_INPUT_DIR } from './chunk-2I3LIRZP.js';
|
|
29
30
|
import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON } from './chunk-JGD5TWQ2.js';
|
|
30
|
-
import { existsSync, statSync, appendFileSync, mkdirSync, chmodSync, writeFileSync, accessSync, constants, openSync, readFileSync, closeSync,
|
|
31
|
+
import { existsSync, statSync, appendFileSync, rmSync, mkdirSync, chmodSync, writeFileSync, accessSync, constants, openSync, readFileSync, closeSync, readdirSync, linkSync, lstatSync, fstatSync, readSync, realpathSync } from 'fs';
|
|
31
32
|
import { join, isAbsolute, dirname, delimiter, sep } from 'path';
|
|
32
|
-
import { spawn, spawnSync } from 'child_process';
|
|
33
|
-
import { randomBytes, createHash } from 'crypto';
|
|
34
33
|
import { once } from 'events';
|
|
35
34
|
import { createServer } from 'net';
|
|
35
|
+
import { spawn, spawnSync } from 'child_process';
|
|
36
|
+
import { randomBytes, createHash } from 'crypto';
|
|
36
37
|
import { pathToFileURL } from 'url';
|
|
37
38
|
|
|
38
39
|
createRequire(import.meta.url);
|
|
39
40
|
var PROBE_TIMEOUT_MS = 3e4;
|
|
40
41
|
var PROBE_BYTES = 256 * 1024;
|
|
41
|
-
|
|
42
|
+
function probeScript(dir, alive) {
|
|
43
|
+
return `d=${dir}
|
|
42
44
|
code=$(cat "$d/exit-code" 2>/dev/null | tr -d ' \\r\\n')
|
|
43
45
|
pid=$(cat "$d/command.pid" 2>/dev/null | tr -d ' \\r\\n')
|
|
44
46
|
alive=0
|
|
45
|
-
if [ -n "$pid" ] &&
|
|
47
|
+
if [ -n "$pid" ] && ${alive}; then alive=1; fi
|
|
46
48
|
size=$(wc -c < "$d/command.log" 2>/dev/null || echo 0)
|
|
47
49
|
size=$(echo $size)
|
|
48
50
|
echo "OL-COMMAND exit=$code alive=$alive size=$size"
|
|
@@ -51,8 +53,10 @@ if [ "$n" -gt "$2" ]; then n=$2; fi
|
|
|
51
53
|
if [ "$n" -gt 0 ]; then tail -c +$(($1 + 1)) "$d/command.log" | head -c "$n" | base64 | tr -d '\\n'; fi
|
|
52
54
|
echo
|
|
53
55
|
`;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
}
|
|
57
|
+
var PROBE_SCRIPT = probeScript(COMMAND_DIR, 'grep -qa build-command "/proc/$pid/cmdline" 2>/dev/null');
|
|
58
|
+
function probeArgv(offset, script = PROBE_SCRIPT) {
|
|
59
|
+
return ["/bin/sh", "-c", script, "probe", String(offset), String(PROBE_BYTES)];
|
|
56
60
|
}
|
|
57
61
|
function parseProbe(stdout) {
|
|
58
62
|
const [header = "", body = ""] = stdout.split("\n");
|
|
@@ -97,14 +101,19 @@ function judgeProbe(probe, missedBefore) {
|
|
|
97
101
|
if (probe.alive) return { kind: "running" };
|
|
98
102
|
return missedBefore ? { kind: "lost" } : { kind: "recheck" };
|
|
99
103
|
}
|
|
100
|
-
async function serveLease(socketPath, channel, makeServer = createServer) {
|
|
104
|
+
async function serveLease(socketPath, channel, makeServer = createServer, listenOn) {
|
|
101
105
|
const server = makeServer((socket) => channel.accept(socket));
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
if (listenOn === void 0) {
|
|
107
|
+
rmSync(socketPath, { force: true });
|
|
108
|
+
server.listen(socketPath);
|
|
109
|
+
await once(server, "listening");
|
|
110
|
+
} else {
|
|
111
|
+
await listenOn(server);
|
|
112
|
+
}
|
|
105
113
|
server.on("error", () => void 0);
|
|
106
114
|
return {
|
|
107
115
|
...channel,
|
|
116
|
+
listener: server,
|
|
108
117
|
close() {
|
|
109
118
|
channel.close();
|
|
110
119
|
server.close();
|
|
@@ -112,6 +121,57 @@ async function serveLease(socketPath, channel, makeServer = createServer) {
|
|
|
112
121
|
}
|
|
113
122
|
};
|
|
114
123
|
}
|
|
124
|
+
|
|
125
|
+
// src/runner/microvm/command-state.ts
|
|
126
|
+
var MICROVM_COMMAND_DIR = "/build/.command";
|
|
127
|
+
var SCRIPT = probeScript(MICROVM_COMMAND_DIR, '[ -d "/proc/$pid" ]');
|
|
128
|
+
var GUEST_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
|
|
129
|
+
var STOP_COMMAND_SCRIPT = `pid=$(cat ${MICROVM_COMMAND_DIR}/command.pid 2>/dev/null | tr -d ' \\r\\n'); [ -n "$pid" ] && kill -KILL "-$pid" 2>/dev/null; true`;
|
|
130
|
+
var EXEC_TIMEOUT_MS = 3e4;
|
|
131
|
+
var ABORT_GRACE_MS = 5e3;
|
|
132
|
+
async function withinTime(exec) {
|
|
133
|
+
const controller = new AbortController();
|
|
134
|
+
let abortTimer;
|
|
135
|
+
let graceTimer;
|
|
136
|
+
const deadline = new Promise((_resolve, reject) => {
|
|
137
|
+
abortTimer = setTimeout(() => {
|
|
138
|
+
controller.abort();
|
|
139
|
+
graceTimer = setTimeout(() => reject(new Error("the guest did not end the exec after it was aborted")), ABORT_GRACE_MS);
|
|
140
|
+
}, EXEC_TIMEOUT_MS);
|
|
141
|
+
});
|
|
142
|
+
try {
|
|
143
|
+
return await Promise.race([exec(controller.signal), deadline]);
|
|
144
|
+
} finally {
|
|
145
|
+
clearTimeout(abortTimer);
|
|
146
|
+
clearTimeout(graceTimer);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async function probeMicroVmCommand(runtime, state, offset) {
|
|
150
|
+
try {
|
|
151
|
+
const result = await withinTime(
|
|
152
|
+
(signal) => runtime.vm.exec(state.vsockPath, { argv: probeArgv(offset, SCRIPT), user: state.agentUser ?? ADDED_USER, cwd: "/", env: { PATH: GUEST_PATH } }, { signal })
|
|
153
|
+
);
|
|
154
|
+
return result.status === 0 ? parseProbe(result.stdout) : void 0;
|
|
155
|
+
} catch {
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
var MAX_TAIL_READS2 = 8;
|
|
160
|
+
async function copyMicroVmLogTail(runtime, state, jobDir) {
|
|
161
|
+
for (let reads = 0; reads < MAX_TAIL_READS2; reads++) {
|
|
162
|
+
const offset = commandLogOffset(jobDir, state.commandLogBase);
|
|
163
|
+
const probe = await probeMicroVmCommand(runtime, state, offset);
|
|
164
|
+
if (probe === void 0) return false;
|
|
165
|
+
appendCommandLog(jobDir, probe.bytes);
|
|
166
|
+
if (probe.bytes.length === 0 || offset + probe.bytes.length >= probe.size) return true;
|
|
167
|
+
}
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
async function stopMicroVmCommand(runtime, state) {
|
|
171
|
+
await withinTime(
|
|
172
|
+
(signal) => runtime.vm.exec(state.vsockPath, { argv: ["/bin/sh", "-c", STOP_COMMAND_SCRIPT], user: "root", cwd: "/", env: { PATH: GUEST_PATH } }, { signal })
|
|
173
|
+
);
|
|
174
|
+
}
|
|
115
175
|
function unitNameFor(buildId) {
|
|
116
176
|
return `outerlayer-build-${buildId}`;
|
|
117
177
|
}
|
|
@@ -256,6 +316,30 @@ async function microVmOomKills(runtime, state) {
|
|
|
256
316
|
if (state.jailed !== void 0) return helperKills(runtime, state);
|
|
257
317
|
return 0;
|
|
258
318
|
}
|
|
319
|
+
var socketNameOf = (file) => file.replace(/\.sock$/, "");
|
|
320
|
+
async function keepSockets(runtime, buildId, listeners, leaseServer, line, error) {
|
|
321
|
+
const store = runtime.vm.fdStore;
|
|
322
|
+
const status = await store.status();
|
|
323
|
+
if (!status.ok) {
|
|
324
|
+
line(`this build ends with its runner: ${status.reason}`);
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
const sockets = Object.entries(listeners);
|
|
328
|
+
if (leaseServer !== void 0) sockets.push([LEASE_LINK.socket, leaseServer]);
|
|
329
|
+
const stored = [];
|
|
330
|
+
try {
|
|
331
|
+
for (const [file, server] of sockets) {
|
|
332
|
+
const name = fdName(buildId, socketNameOf(file));
|
|
333
|
+
await store.push(name, server);
|
|
334
|
+
stored.push(name);
|
|
335
|
+
}
|
|
336
|
+
} catch (err) {
|
|
337
|
+
error(`this build ends with its runner: its sockets could not be kept for the next one: ${describeCallFailure(err)}`);
|
|
338
|
+
for (const name of stored) await store.remove(name).catch(() => void 0);
|
|
339
|
+
return [];
|
|
340
|
+
}
|
|
341
|
+
return stored;
|
|
342
|
+
}
|
|
259
343
|
async function provisionMicroVm(input) {
|
|
260
344
|
const { config, runtime, item, itemKey, jobDir, log, tokens } = input;
|
|
261
345
|
const { vm } = runtime;
|
|
@@ -363,9 +447,11 @@ async function provisionMicroVm(input) {
|
|
|
363
447
|
mkdirSync(buildDir2, { recursive: true, mode: 448 });
|
|
364
448
|
chmodSync(buildDir2, 448);
|
|
365
449
|
makeBuildsDirPrivate(buildDir2);
|
|
450
|
+
let services;
|
|
366
451
|
try {
|
|
367
452
|
const gitRemote = gitRemoteFor(runtime, { repositories, tokens, buildDir: buildDir2, log: (line) => log.line(`${tag} ${line}`) });
|
|
368
|
-
|
|
453
|
+
services = await startServicesFor(runtime, config, buildDir2, jobDir, itemKey, true, gitRemote);
|
|
454
|
+
runtime.tunnels.set(buildId, services);
|
|
369
455
|
} catch (err) {
|
|
370
456
|
return bail(`the tunnel could not start: ${describeCallFailure(err)}`);
|
|
371
457
|
}
|
|
@@ -376,11 +462,13 @@ async function provisionMicroVm(input) {
|
|
|
376
462
|
};
|
|
377
463
|
const links = vsockLinks({ destinations: config.build?.destinations?.length ?? 0, builtIns: true });
|
|
378
464
|
const served = input.leaseTimeLeftMs === void 0 ? links : [...links, LEASE_LINK];
|
|
465
|
+
let leaseServer;
|
|
379
466
|
if (input.leaseTimeLeftMs !== void 0) {
|
|
380
467
|
try {
|
|
381
468
|
const channel = createLeaseChannel(input.leaseTimeLeftMs);
|
|
382
469
|
const served2 = await serveLease(join(buildDir2, LEASE_LINK.socket), { ...channel, accept: (stream) => runtime.leases.get(buildId)?.accept(stream) });
|
|
383
470
|
runtime.leases.set(buildId, { ...channel, close: served2.close });
|
|
471
|
+
leaseServer = served2.listener;
|
|
384
472
|
} catch (err) {
|
|
385
473
|
return bail(`the lease stream could not start: ${describeCallFailure(err)}`);
|
|
386
474
|
}
|
|
@@ -430,6 +518,11 @@ async function provisionMicroVm(input) {
|
|
|
430
518
|
} catch (err) {
|
|
431
519
|
return bail(`the microVM did not start under the jailer: ${describeCallFailure(err)}`);
|
|
432
520
|
}
|
|
521
|
+
const kept = await keepSockets(runtime, buildId, services.listeners, leaseServer, (line) => log.line(`${tag} ${line}`), (line) => log.error(`${tag} ${line}`));
|
|
522
|
+
if (kept.length > 0) {
|
|
523
|
+
state.fdStore = kept;
|
|
524
|
+
input.save(state, environment);
|
|
525
|
+
}
|
|
433
526
|
} else {
|
|
434
527
|
try {
|
|
435
528
|
state.firecracker = await vm.firecracker.spawn({ binary: assets.firecracker, configPath, consolePath, cgroup: state.cgroup });
|
|
@@ -539,7 +632,8 @@ async function provisionMicroVm(input) {
|
|
|
539
632
|
return { ok: false, reason: `context_unavailable: ${describeCallFailure(err)}` };
|
|
540
633
|
}
|
|
541
634
|
},
|
|
542
|
-
removeStagedContext: () => removeStagedContext(buildDir2)
|
|
635
|
+
removeStagedContext: () => removeStagedContext(buildDir2),
|
|
636
|
+
keepIn: jobDir
|
|
543
637
|
});
|
|
544
638
|
if (!steps.ok) return bail(steps.reason, steps.aborted === true);
|
|
545
639
|
state.startCommit = steps.startCommit;
|
|
@@ -605,6 +699,38 @@ function microVmCommandLine(input) {
|
|
|
605
699
|
const { options, env } = vmExecFor(input, ["/bin/sh", "-c", commandWithShim(input.job, input.cmdline)]);
|
|
606
700
|
return { line: [process.execPath, input.cli, "vm-exec", ...vmExecArgs(options)].map(shellQuote).join(" "), options, env };
|
|
607
701
|
}
|
|
702
|
+
async function startMicroVmCommand(input) {
|
|
703
|
+
const state = input.job.microvm;
|
|
704
|
+
const env = buildEnvironment({
|
|
705
|
+
config: input.config,
|
|
706
|
+
item: input.job.item,
|
|
707
|
+
itemKey: input.job.itemKey,
|
|
708
|
+
branch: input.job.branch,
|
|
709
|
+
repository: state.repository,
|
|
710
|
+
repositories: input.job.repositories,
|
|
711
|
+
hostEnv: input.runtime.hostEnv,
|
|
712
|
+
containerEnv: state.containerEnv ?? {},
|
|
713
|
+
builtIns: state.builtIns === true,
|
|
714
|
+
identity: input.job.commitIdentity,
|
|
715
|
+
imageEnv: state.imageEnv
|
|
716
|
+
});
|
|
717
|
+
const started = await input.runtime.vm.exec(state.vsockPath, {
|
|
718
|
+
argv: ["/bin/sh", "-c", commandWithShim(input.job, input.cmdline)],
|
|
719
|
+
user: state.agentUser ?? ADDED_USER,
|
|
720
|
+
cwd: CHECKOUT_DIR,
|
|
721
|
+
env: execEnvironment(state.imageEnv, env),
|
|
722
|
+
detach: state.commandDir ?? MICROVM_COMMAND_DIR
|
|
723
|
+
});
|
|
724
|
+
if (started.status !== 0) {
|
|
725
|
+
const said = firstLine(started.stderr);
|
|
726
|
+
throw new Error(`the guest's exec agent exited ${started.status}${said === "" ? "" : `: ${said}`}`);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
async function endMicroVmCommand(runtime, state, jobDir, onError) {
|
|
730
|
+
if (!vmAlive(runtime, state)) return;
|
|
731
|
+
await copyMicroVmLogTail(runtime, state, jobDir).catch((err) => onError(`copying the end of the command's log failed: ${describeCallFailure(err)} \xB7 continuing`));
|
|
732
|
+
await stopMicroVmCommand(runtime, state).catch((err) => onError(`ending the command in the microVM failed: ${describeCallFailure(err)} \xB7 continuing`));
|
|
733
|
+
}
|
|
608
734
|
function microVmSenderCommand(input) {
|
|
609
735
|
const { options, env } = vmExecFor(input, ["outerlayer", "session-sender"]);
|
|
610
736
|
return { command: process.execPath, args: [input.cli, "vm-exec", ...vmExecArgs(options)], env };
|
|
@@ -953,6 +1079,7 @@ async function cleanupMicroVm(runtime, state, jobDir) {
|
|
|
953
1079
|
runtime.tunnels.delete(state.buildId);
|
|
954
1080
|
await tunnel.close();
|
|
955
1081
|
}
|
|
1082
|
+
for (const name of state.fdStore ?? []) await runtime.vm.fdStore.remove(name).catch(() => void 0);
|
|
956
1083
|
rmSync(state.buildDir, { recursive: true, force: true });
|
|
957
1084
|
if (failures.length > 0) throw new Error(failures.join("; "));
|
|
958
1085
|
}
|
|
@@ -960,7 +1087,9 @@ async function stopOrphanedMicroVms(input) {
|
|
|
960
1087
|
const stopped = [];
|
|
961
1088
|
const report = (line) => input.onError?.(line);
|
|
962
1089
|
const jailedByJobs = [];
|
|
1090
|
+
const kept = input.keep ?? /* @__PURE__ */ new Set();
|
|
963
1091
|
for (const { job } of input.jobs) {
|
|
1092
|
+
if (job.microvm !== void 0 && kept.has(job.microvm.buildId)) continue;
|
|
964
1093
|
const states = [job.microvm, job.checkMicrovm].filter((state) => state !== void 0);
|
|
965
1094
|
if (states.length === 0) continue;
|
|
966
1095
|
if (job.pid !== void 0 && job.start !== void 0 && isSameProcess(job.pid, job.start)) {
|
|
@@ -996,6 +1125,7 @@ async function stopOrphanedMicroVms(input) {
|
|
|
996
1125
|
return stopped;
|
|
997
1126
|
}
|
|
998
1127
|
for (const build of builds) {
|
|
1128
|
+
if (kept.has(build)) continue;
|
|
999
1129
|
try {
|
|
1000
1130
|
await probe.client.stop(build);
|
|
1001
1131
|
} catch (err) {
|
|
@@ -1236,6 +1366,9 @@ function decideFromEvaluation(read) {
|
|
|
1236
1366
|
}
|
|
1237
1367
|
return { outcome: "incomplete", reason: fit("the item's verdict is not passing: ", [evaluation.sentence || evaluation.verdict]) };
|
|
1238
1368
|
}
|
|
1369
|
+
function incompleteReason(reason, judgeNotRun) {
|
|
1370
|
+
return judgeNotRun === void 0 ? reason : `the judge did not run (${judgeNotRun}) \xB7 ${reason}`;
|
|
1371
|
+
}
|
|
1239
1372
|
function waitMs(ms) {
|
|
1240
1373
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1241
1374
|
}
|
|
@@ -1425,6 +1558,18 @@ function readInside(root, rel) {
|
|
|
1425
1558
|
return void 0;
|
|
1426
1559
|
}
|
|
1427
1560
|
}
|
|
1561
|
+
var MAINTAINED_BRIEF = /^\.(?:agents|outerlayer)\/skills\/(outerlayer-[a-z]+)\/([A-Za-z0-9_./-]+)$/;
|
|
1562
|
+
function readBrief(root, brief) {
|
|
1563
|
+
const own = readInside(root, brief);
|
|
1564
|
+
if (own !== void 0) return own;
|
|
1565
|
+
const match = MAINTAINED_BRIEF.exec(brief);
|
|
1566
|
+
if (match === null || match[2].split("/").includes("..") || !MAINTAINED_SKILLS.includes(match[1])) return void 0;
|
|
1567
|
+
try {
|
|
1568
|
+
return readFileSync(join(resolvePackRoot(), "maintained", match[1], match[2]), "utf8");
|
|
1569
|
+
} catch {
|
|
1570
|
+
return void 0;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1428
1573
|
function validatorFilesIn(root) {
|
|
1429
1574
|
const dir = join(root, VALIDATORS_DIR);
|
|
1430
1575
|
let names;
|
|
@@ -1449,7 +1594,7 @@ function checksIn(root, log, tag) {
|
|
|
1449
1594
|
const hostChecks = loaded.customs.filter((def) => def.runWhere === "host" && def.level !== "off" && def.declaresEmit !== null);
|
|
1450
1595
|
const checks = [];
|
|
1451
1596
|
for (const def of hostChecks) {
|
|
1452
|
-
if (def.judge !== void 0) checks.push({ name: def.declaresEmit, judge: { brief: def.judge.brief, text:
|
|
1597
|
+
if (def.judge !== void 0) checks.push({ name: def.declaresEmit, judge: { brief: def.judge.brief, text: readBrief(root, def.judge.brief) } });
|
|
1453
1598
|
else if (def.command !== void 0) checks.push({ name: def.declaresEmit, command: def.command });
|
|
1454
1599
|
}
|
|
1455
1600
|
return checks;
|
|
@@ -1460,6 +1605,8 @@ async function readDefinitions(input, repository, scratch, token, tokens) {
|
|
|
1460
1605
|
const stage = deps.stage ?? stageGovernedContext;
|
|
1461
1606
|
const controlPlaneUrl = (controlPlane) => deps.runtime.remoteFor?.(controlPlane) ?? `${deps.runtime.github.gitUrl}/${controlPlane}.git`;
|
|
1462
1607
|
const governing = (job.container ?? job.microvm)?.governing;
|
|
1608
|
+
const kept = keptContextTree(input.jobDir, governing);
|
|
1609
|
+
if (kept !== void 0) return { ok: true, checks: checksIn(kept, deps.log, tag) };
|
|
1463
1610
|
const staged = await stage({
|
|
1464
1611
|
config,
|
|
1465
1612
|
repository,
|
|
@@ -1918,6 +2065,7 @@ async function runJudge(input) {
|
|
|
1918
2065
|
if (!definitions.ok) {
|
|
1919
2066
|
rmSync(scratch, { recursive: true, force: true });
|
|
1920
2067
|
log.line(`${tag} judge not run: the definitions could not be read: ${definitions.reason}`);
|
|
2068
|
+
job.judgeNotRun = `the definitions could not be read: ${definitions.reason}`;
|
|
1921
2069
|
const passed = await retrySend(() => hostPassedNames(config, job.item, deps.fetchImpl), { now: deps.now });
|
|
1922
2070
|
if (!passed.ok) {
|
|
1923
2071
|
log.error(`${tag} the item's host results could not be read, so none was failed: ${passed.reason}`);
|
|
@@ -2557,6 +2705,9 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
|
|
|
2557
2705
|
const build = job.container === void 0 ? void 0 : { state: job.container, runtime: deps.container ?? createContainerRuntime() };
|
|
2558
2706
|
const vmBuild = job.microvm === void 0 ? void 0 : { state: job.microvm, runtime: deps.container ?? createContainerRuntime() };
|
|
2559
2707
|
const commandMayRun = job.pid !== void 0 && isGroupAlive(job.pid) || isContainerTracked(job) && job.exitCode === void 0;
|
|
2708
|
+
if (vmBuild !== void 0 && isMicroVmTracked(job) && job.exitCode === void 0) {
|
|
2709
|
+
await endMicroVmCommand(vmBuild.runtime, vmBuild.state, jobDirPath, (line) => log.error(`${tag} ${line}`));
|
|
2710
|
+
}
|
|
2560
2711
|
if (build !== void 0 && commandMayRun) {
|
|
2561
2712
|
if (isContainerTracked(job) && build.state.stopped !== true) {
|
|
2562
2713
|
await copyCommandLogTail(build.runtime, build.state, jobDirPath).catch((err) => {
|
|
@@ -2630,8 +2781,11 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
|
|
|
2630
2781
|
}
|
|
2631
2782
|
if (job.checkMicrovm !== void 0 && job.checksRan === true) {
|
|
2632
2783
|
try {
|
|
2633
|
-
|
|
2784
|
+
const runtime = deps.container ?? createContainerRuntime();
|
|
2785
|
+
const again = isMicroVmTracked(job) && outcome === "ok" && !job.cleanupRan;
|
|
2786
|
+
await cleanupMicroVm(runtime, job.checkMicrovm);
|
|
2634
2787
|
delete job.checkMicrovm;
|
|
2788
|
+
if (again) job.checksRan = false;
|
|
2635
2789
|
writeJobFile(jobFilePath, job);
|
|
2636
2790
|
} catch (err) {
|
|
2637
2791
|
log.error(`${tag} removing an earlier attempt's check environment failed: ${describeCallFailure(err)} \xB7 continuing`);
|
|
@@ -2667,6 +2821,7 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
|
|
|
2667
2821
|
log.error(`${tag} the host's checks stopped: ${describeCallFailure(err)} \xB7 continuing`);
|
|
2668
2822
|
}
|
|
2669
2823
|
}
|
|
2824
|
+
removeKeptContext(jobDirPath);
|
|
2670
2825
|
let outOfMemory;
|
|
2671
2826
|
if ((vmBuild?.state.cgroup !== void 0 || vmBuild?.state.jailed !== void 0) && outcome !== void 0 && outcome !== "ok" && ending?.reason === void 0) {
|
|
2672
2827
|
try {
|
|
@@ -2783,7 +2938,7 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
|
|
|
2783
2938
|
});
|
|
2784
2939
|
if (decision.outcome === "incomplete") {
|
|
2785
2940
|
outcome = "incomplete";
|
|
2786
|
-
verdictReason = scrubReason(decision.reason, config);
|
|
2941
|
+
verdictReason = scrubReason(incompleteReason(decision.reason, job.judgeNotRun), config);
|
|
2787
2942
|
log.error(`${tag} the command exited 0 but the item is not done: ${verdictReason}`);
|
|
2788
2943
|
}
|
|
2789
2944
|
}
|
|
@@ -2939,6 +3094,15 @@ function unfinishedJobs(jobsDirPath) {
|
|
|
2939
3094
|
function isContainerTracked(job) {
|
|
2940
3095
|
return job.container?.tracking === "container";
|
|
2941
3096
|
}
|
|
3097
|
+
function isMicroVmTracked(job) {
|
|
3098
|
+
return job.microvm?.tracking === "microvm";
|
|
3099
|
+
}
|
|
3100
|
+
function isTracked(job) {
|
|
3101
|
+
return isContainerTracked(job) || isMicroVmTracked(job);
|
|
3102
|
+
}
|
|
3103
|
+
function trackingOf(job) {
|
|
3104
|
+
return job.container?.tracking ?? job.microvm?.tracking;
|
|
3105
|
+
}
|
|
2942
3106
|
function isReadable(job) {
|
|
2943
3107
|
return readsJobState(job, READ_JOB_STATE_FORMATS);
|
|
2944
3108
|
}
|
|
@@ -2948,10 +3112,10 @@ function listUnreadableJobs(jobsDirPath) {
|
|
|
2948
3112
|
function listTrackedJobs(jobsDirPath) {
|
|
2949
3113
|
return unfinishedJobs(jobsDirPath).flatMap(({ dirPath, job }) => {
|
|
2950
3114
|
if (!isReadable(job)) return [];
|
|
2951
|
-
const tracking = job
|
|
3115
|
+
const tracking = trackingOf(job);
|
|
2952
3116
|
if (tracking === void 0) return [];
|
|
2953
|
-
if (tracking === "container" && inTeardown(job)) return [];
|
|
2954
|
-
return [{ dirPath, job, known: tracking === "container" }];
|
|
3117
|
+
if ((tracking === "container" || tracking === "microvm") && inTeardown(job)) return [];
|
|
3118
|
+
return [{ dirPath, job, known: tracking === "container" || tracking === "microvm" }];
|
|
2955
3119
|
});
|
|
2956
3120
|
}
|
|
2957
3121
|
function listAdoptableJobs(jobsDirPath) {
|
|
@@ -2963,12 +3127,12 @@ async function recoverLostJobs(jobsDirPath, config, deps) {
|
|
|
2963
3127
|
const recovered = [];
|
|
2964
3128
|
for (const { dirPath, job } of unfinishedJobs(jobsDirPath)) {
|
|
2965
3129
|
if (!isReadable(job)) continue;
|
|
2966
|
-
const tracking = job
|
|
2967
|
-
if (tracking !== void 0 && tracking !== "container") {
|
|
3130
|
+
const tracking = trackingOf(job);
|
|
3131
|
+
if (tracking !== void 0 && tracking !== "container" && tracking !== "microvm") {
|
|
2968
3132
|
recovered.push(await finishJob(job, dirPath, "interrupted", config, deps, { reason: UNKNOWN_TRACKING_REASON }));
|
|
2969
3133
|
continue;
|
|
2970
3134
|
}
|
|
2971
|
-
if (tracking === "container" && !inTeardown(job)) continue;
|
|
3135
|
+
if ((tracking === "container" || tracking === "microvm") && !inTeardown(job)) continue;
|
|
2972
3136
|
const alive = job.pid !== void 0 && job.start !== void 0 && isSameProcess(job.pid, job.start);
|
|
2973
3137
|
if (alive) continue;
|
|
2974
3138
|
const recorded = outcomeFromExitCode(dirPath);
|
|
@@ -3136,4 +3300,4 @@ async function stopSender(input) {
|
|
|
3136
3300
|
}
|
|
3137
3301
|
}
|
|
3138
3302
|
|
|
3139
|
-
export { ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, RENEW_INTERVAL_SECONDS, appendCommandLog, commandLogOffset, deliverCommitHooks, describeHookEnd, execArgv, execCommandLine, finishJob, hookLimitsFor, hostCommandEnvironment, hostEnvironment, inTeardown, isContainerTracked, isGroupAlive, isIdle, isReadable, isTimedOut, isUnfinished, jobEnv, judgeProbe, listAdoptableJobs, listTrackedJobs, listUnreadableJobs, listenOnBroker, microVmCommandLine, needsRenew, outcomeFromExitCode, probeCommand, provisionEnvironment, provisionMicroVm, provisionProcess, readCpuUsec, readProvisionOut, recoverLostJobs, releaseLease, renewLease, resolveHostBuild, restartSender, retryFailedReleases, runCommand, runHook, setStage, startHostServices, startSender, stopOrphanedMicroVms, unfinishedJobs, workdirProblem };
|
|
3303
|
+
export { ALREADY_RELEASED, AttemptLogBook, EXIT_CODE_FILE, MICROVM_COMMAND_DIR, RENEW_INTERVAL_SECONDS, appendCommandLog, commandLogOffset, deliverCommitHooks, describeHookEnd, execArgv, execCommandLine, finishJob, hookLimitsFor, hostCommandEnvironment, hostEnvironment, inTeardown, isContainerTracked, isGroupAlive, isIdle, isMicroVmTracked, isReadable, isTimedOut, isTracked, isUnfinished, jobEnv, judgeProbe, listAdoptableJobs, listTrackedJobs, listUnreadableJobs, listenOnBroker, microVmCommandLine, microVmOomKills, needsRenew, outcomeFromExitCode, probeCommand, probeMicroVmCommand, provisionEnvironment, provisionMicroVm, provisionProcess, readCpuUsec, readProvisionOut, recoverLostJobs, releaseLease, renewLease, resolveHostBuild, restartSender, retryFailedReleases, runCommand, runHook, serveLease, setStage, startHostServices, startMicroVmCommand, startSender, stopOrphanedMicroVms, unfinishedJobs, vmAlive, workdirProblem, writeGuestGhConfig };
|
|
@@ -33,12 +33,14 @@ function inspectService(unit, configDir, probes) {
|
|
|
33
33
|
const pid = Number(property(shown, "MainPID") ?? "0");
|
|
34
34
|
const mainPid = Number.isInteger(pid) && pid > 0 ? pid : void 0;
|
|
35
35
|
const delegate = property(shown, "Delegate");
|
|
36
|
+
const storeMax = Number(property(shown, "FileDescriptorStoreMax"));
|
|
36
37
|
const status = mainPid === void 0 ? void 0 : probes.readFile(`/proc/${mainPid}/status`);
|
|
37
38
|
const kvm = probes.kvmGid();
|
|
38
39
|
return {
|
|
39
40
|
unit,
|
|
40
41
|
mainPid,
|
|
41
42
|
delegate: delegate === void 0 ? void 0 : delegate !== "no",
|
|
43
|
+
...Number.isInteger(storeMax) && property(shown, "FileDescriptorStoreMax") !== void 0 ? { fdStoreMax: storeMax } : {},
|
|
42
44
|
hasKvmGroup: status === void 0 || kvm === void 0 ? void 0 : holdsGroup(status, kvm),
|
|
43
45
|
credentialVariables: credentialNames(probes.readFile(join(configDir, "runner.env")))
|
|
44
46
|
};
|
|
@@ -46,7 +48,7 @@ function inspectService(unit, configDir, probes) {
|
|
|
46
48
|
function realInspectProbes() {
|
|
47
49
|
return {
|
|
48
50
|
show: (unit) => {
|
|
49
|
-
const result = spawnSync("systemctl", ["show", "--property=LoadState,MainPID,Delegate", unit], { encoding: "utf8", timeout: 1e4 });
|
|
51
|
+
const result = spawnSync("systemctl", ["show", "--property=LoadState,MainPID,Delegate,FileDescriptorStoreMax", unit], { encoding: "utf8", timeout: 1e4 });
|
|
50
52
|
return result.status === 0 ? result.stdout : void 0;
|
|
51
53
|
},
|
|
52
54
|
readFile: (path) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { checkStarterFiles, contextIsGoverned, checkBuildSkill } from './chunk-
|
|
4
|
-
import { resolveCredentials, getJson, WorkCommandError } from './chunk-
|
|
5
|
-
import { isLinkedRepository } from './chunk-
|
|
3
|
+
import { checkStarterFiles, contextIsGoverned, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills } from './chunk-G3EZA6MK.js';
|
|
4
|
+
import { resolveCredentials, getJson, WorkCommandError } from './chunk-55GNQPO6.js';
|
|
5
|
+
import { isLinkedRepository } from './chunk-N4D5TMVU.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
7
|
-
import { checkFormerSkillNames } from './chunk-
|
|
8
|
-
import { resolveGatewayCredentials, defaultFetch } from './chunk-
|
|
9
|
-
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-
|
|
7
|
+
import { checkFormerSkillNames } from './chunk-MHX7YX7Y.js';
|
|
8
|
+
import { resolveGatewayCredentials, defaultFetch } from './chunk-BWH36FOC.js';
|
|
9
|
+
import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-DJHNEGNM.js';
|
|
10
10
|
import { readStatuslineState, STATE_FRESH_MS } from './chunk-I7RZHMXW.js';
|
|
11
11
|
import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
12
12
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
@@ -191,7 +191,7 @@ function runDoctor(env = {}) {
|
|
|
191
191
|
...checkInstalls(env),
|
|
192
192
|
...starter?.checks ?? [],
|
|
193
193
|
...laptop ? checkRenamedSkills(env.cwd) : [],
|
|
194
|
-
...checkBuildSkillState(env.cwd),
|
|
194
|
+
...checkBuildSkillState(env.cwd, home),
|
|
195
195
|
...starter !== void 0 && !starter.mcpOutdated ? checkMcpCommand(env.cwd, env.processEnv) : [],
|
|
196
196
|
...checkContextSource(env.cwd),
|
|
197
197
|
...checkGovernsList(env.cwd),
|
|
@@ -204,10 +204,10 @@ function checkRenamedSkills(cwd) {
|
|
|
204
204
|
if (dirs === void 0 || contextIsGoverned(dirs.gitCommonDir)) return [];
|
|
205
205
|
return checkFormerSkillNames(dirs.repoRoot);
|
|
206
206
|
}
|
|
207
|
-
function checkBuildSkillState(cwd) {
|
|
207
|
+
function checkBuildSkillState(cwd, home) {
|
|
208
208
|
const dirs = findGitDirs(cwd ?? process.cwd());
|
|
209
209
|
if (dirs === void 0 || contextIsGoverned(dirs.gitCommonDir)) return [];
|
|
210
|
-
return checkBuildSkill(dirs.repoRoot);
|
|
210
|
+
return [...checkBuildSkill(dirs.repoRoot), ...checkMachineSkills({ repoRoot: dirs.repoRoot, home }), ...checkCommittedMaintainedSkills(dirs.repoRoot)];
|
|
211
211
|
}
|
|
212
212
|
function checkInstalledCli(home, cwd) {
|
|
213
213
|
const name = "Installed CLI";
|
|
@@ -1174,7 +1174,7 @@ function doctorExitCode(checks) {
|
|
|
1174
1174
|
|
|
1175
1175
|
// src/doctor-report.ts
|
|
1176
1176
|
async function gatherDoctorChecks() {
|
|
1177
|
-
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-
|
|
1177
|
+
const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-TWS5VZEN.js');
|
|
1178
1178
|
const configPath = defaultRunnerConfigPath();
|
|
1179
1179
|
const checks = runDoctor({ runnerHost: hasRunnerBlock(configPath) });
|
|
1180
1180
|
const credential = await credentialChecks();
|
|
@@ -1186,7 +1186,7 @@ async function gatherDoctorChecks() {
|
|
|
1186
1186
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1187
1187
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1188
1188
|
} else if (hasRunnerBlock(configPath)) {
|
|
1189
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1189
|
+
const { runnerHostChecks } = await import('./doctor-6ZIF2BRZ.js');
|
|
1190
1190
|
const hooks = (() => {
|
|
1191
1191
|
try {
|
|
1192
1192
|
return loadRunnerConfig(configPath).hooks;
|
|
@@ -1220,8 +1220,8 @@ async function gatherDoctorChecks() {
|
|
|
1220
1220
|
const service = await (async () => {
|
|
1221
1221
|
const { existsSync: existsSync3 } = await import('fs');
|
|
1222
1222
|
if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
|
|
1223
|
-
const { inspectService, realInspectProbes } = await import('./inspect-
|
|
1224
|
-
const { DEFAULT_UNIT_NAME } = await import('./install-
|
|
1223
|
+
const { inspectService, realInspectProbes } = await import('./inspect-IPFA7AAT.js');
|
|
1224
|
+
const { DEFAULT_UNIT_NAME } = await import('./install-6OIY3KHZ.js');
|
|
1225
1225
|
const { dirname: dirname2 } = await import('path');
|
|
1226
1226
|
return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
|
|
1227
1227
|
})();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { MIN_ENGINE_MAJOR } from './chunk-
|
|
4
|
-
import { runnerImageVersion } from './chunk-
|
|
5
|
-
import { firecrackerArch, MICROVM_ARCHES, guestAssetsPinned } from './chunk-
|
|
3
|
+
import { MIN_ENGINE_MAJOR } from './chunk-YF56R4DV.js';
|
|
4
|
+
import { runnerImageVersion } from './chunk-M3MHHIUW.js';
|
|
5
|
+
import { firecrackerArch, MICROVM_ARCHES, guestAssetsPinned } from './chunk-B6K7R5UY.js';
|
|
6
6
|
import { spawnSync } from 'child_process';
|
|
7
7
|
import { existsSync, accessSync, constants, statSync, readFileSync } from 'fs';
|
|
8
8
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { uploadSpooledSteps } from './chunk-
|
|
3
|
+
import { uploadSpooledSteps } from './chunk-O2IJTY7L.js';
|
|
4
4
|
import { LaunchFilter } from './chunk-ESVW4MJY.js';
|
|
5
5
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
6
6
|
import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-BUP5N3X6.js';
|
|
7
|
-
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-
|
|
8
|
-
import { writeSyncStatus, spoolDir } from './chunk-
|
|
7
|
+
import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-BWH36FOC.js';
|
|
8
|
+
import { writeSyncStatus, spoolDir } from './chunk-DJHNEGNM.js';
|
|
9
9
|
import { readLatestProvenanceForSession, readContextProvenance } from './chunk-ZJSNLVCE.js';
|
|
10
10
|
import { hookExecSpoolPath } from './chunk-2O5KA67H.js';
|
|
11
11
|
import { applyReportedCost } from './chunk-BKO6JEZI.js';
|
|
12
12
|
import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
13
13
|
import { setCustomScrubbers, setLocalIdentity, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, sessionIdFromPath, scrubDeep, SOURCE_ADAPTERS } from './chunk-QE3UQAHK.js';
|
|
14
14
|
import { C } from './chunk-ANPNT6PM.js';
|
|
15
|
-
import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-
|
|
15
|
+
import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-PJDQPF5N.js';
|
|
16
16
|
import { readLaunchSpoolState, launchStatusIsDecisive, launchedItemsBySession, launchesPath } from './chunk-T2Q7ISPE.js';
|
|
17
17
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
18
18
|
import { removeJournalHooks } from './chunk-TUSYOL2O.js';
|
|
19
19
|
import { CAPTURE_TIERS, inferArtifactKind, bannedPathsForTier, downconvertSession, isHumanUserTurn, turnCountBound, EVENT_TYPES } from './chunk-QZBXLLTV.js';
|
|
20
20
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
21
|
-
import { signerFor, signRunnerRequest } from './chunk-
|
|
21
|
+
import { signerFor, signRunnerRequest } from './chunk-Y4OKEFAX.js';
|
|
22
22
|
import { dirname, basename, join } from 'path';
|
|
23
23
|
import { statSync, readFileSync, readdirSync, mkdirSync, writeFileSync, renameSync, existsSync, rmSync } from 'fs';
|
|
24
24
|
import { execFileSync } from 'child_process';
|