@outerlayer/cli 0.26.4 → 0.27.1
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 +23 -0
- package/README.md +12 -9
- package/dist/{agent-setup-5DXPEO64.js → agent-setup-UW36TAQM.js} +11 -11
- package/dist/{bridge-5KZ36YDG.js → bridge-B5VJVECY.js} +2 -2
- package/dist/build-HRLACBOZ.js +12 -0
- package/dist/build-info.json +1 -1
- package/dist/{builder-KDUXCHTY.js → builder-6Y6ZWGNH.js} +6 -6
- package/dist/{check-ZSYCR5WG.js → check-YTXFVWK7.js} +41 -40
- package/dist/{chunk-B6K7R5UY.js → chunk-2BTFKNTR.js} +2 -2
- package/dist/{chunk-H57M3HC7.js → chunk-2F762IXY.js} +2 -2
- package/dist/{chunk-2K3TCQHW.js → chunk-2I3LIRZP.js} +26 -8
- package/dist/{chunk-6CGXSMKX.js → chunk-55GNQPO6.js} +17 -6
- package/dist/{chunk-V3YJFEZA.js → chunk-5VMDGJGH.js} +274 -45
- package/dist/{chunk-OQUD3UYF.js → chunk-64GMBWAK.js} +5 -5
- package/dist/{chunk-MWPBF2XG.js → chunk-6KKM7VGZ.js} +32 -4
- package/dist/{chunk-VPEGE3QZ.js → chunk-6TRNCUM4.js} +1 -1
- package/dist/{chunk-27RDUTQH.js → chunk-6VFH52MP.js} +195 -39
- package/dist/{chunk-6SPXKRQR.js → chunk-7AQ5AM7U.js} +12 -5
- package/dist/{chunk-HBISTTG3.js → chunk-7OUOLGUV.js} +20 -5
- package/dist/{chunk-NWPRNKZ5.js → chunk-ABXQBEYK.js} +1 -1
- package/dist/{chunk-EHBDYLM6.js → chunk-B7DJVG25.js} +3 -3
- package/dist/{chunk-4UFSTKE5.js → chunk-BPKO76QR.js} +4 -4
- package/dist/{chunk-MCSINUVC.js → chunk-BWH36FOC.js} +1 -1
- package/dist/{chunk-IZAOO5AR.js → chunk-D7ECMB7B.js} +4 -4
- package/dist/{chunk-UZEQVPKF.js → chunk-DJHNEGNM.js} +27 -3
- package/dist/{chunk-O4362FPA.js → chunk-E5IJ5533.js} +2 -2
- package/dist/{chunk-JWRX5ZTT.js → chunk-EPPIISRD.js} +2 -2
- package/dist/{chunk-QUP6CVBQ.js → chunk-EX5MQYEF.js} +5 -5
- package/dist/{chunk-KNBWOL2B.js → chunk-FP23SVDD.js} +5 -5
- package/dist/{chunk-VGHKTSHU.js → chunk-GFUE5TKO.js} +3 -3
- package/dist/{chunk-XLC7KEUV.js → chunk-GLUKDQS4.js} +1 -1
- package/dist/{chunk-GFHLEVUE.js → chunk-HWDYLXHH.js} +7 -4
- package/dist/chunk-IMOB4IOI.js +181 -0
- package/dist/{chunk-JKNYTNYD.js → chunk-LOKSLO25.js} +1 -1
- package/dist/{chunk-ZMZGWLYD.js → chunk-LPFOWUHG.js} +13 -13
- package/dist/{chunk-2J46BQ5Y.js → chunk-M3MHHIUW.js} +1 -1
- package/dist/{chunk-7Z2WMXM5.js → chunk-MATUHHN4.js} +1 -1
- package/dist/{chunk-MQ743JX3.js → chunk-MHX7YX7Y.js} +1 -1
- package/dist/{chunk-PZA6ZFYW.js → chunk-N4D5TMVU.js} +2 -2
- package/dist/{chunk-WK35HB56.js → chunk-O2IJTY7L.js} +2 -2
- package/dist/{chunk-6WTAYEKJ.js → chunk-P33PZIWS.js} +55 -7
- package/dist/{chunk-K4FXNMV5.js → chunk-QHH4OSD4.js} +1 -1
- package/dist/{chunk-Y4BXRVDI.js → chunk-QKIQ2R7F.js} +3 -3
- package/dist/{chunk-SBW4K3XZ.js → chunk-R7SGBXUD.js} +76 -30
- package/dist/{chunk-F3BBEBPL.js → chunk-RHAGBUL5.js} +1 -1
- package/dist/{chunk-OFTFW7TH.js → chunk-RHGF73IU.js} +1 -1
- package/dist/{chunk-6MZSX4M7.js → chunk-STSLH5EJ.js} +3 -1
- package/dist/{chunk-VQ7OAG6H.js → chunk-VS27BP3E.js} +4 -4
- package/dist/{chunk-OZKEEXVH.js → chunk-WSYXLLA5.js} +6 -6
- package/dist/{chunk-WX2WEERU.js → chunk-WUL2OP5A.js} +3 -3
- 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-GWRDL75D.js → chunk-Y4OKEFAX.js} +1 -1
- package/dist/{chunk-Q2SVLBMI.js → chunk-Y7ZCHBYB.js} +2 -2
- package/dist/chunk-YB3CSYXX.js +95 -0
- package/dist/chunk-YJLHUKYS.js +38 -0
- package/dist/{chunk-UOGQZQXN.js → chunk-ZFBJUOYT.js} +6 -6
- package/dist/{claude-launcher-TTLTS4N6.js → claude-launcher-NQSZBTQ5.js} +8 -4
- package/dist/{cli-SKF3AMZ5.js → cli-GHEOBXC7.js} +133 -127
- package/dist/{command-E5OG5NCH.js → command-V7B7GTPZ.js} +30 -29
- package/dist/{config-JJ3EO7SB.js → config-TWS5VZEN.js} +3 -3
- package/dist/{connect-cmd-SL4S5HJM.js → connect-cmd-HGS7YPA2.js} +7 -7
- package/dist/{container-start-IA2HK4QI.js → container-start-FHB2VDC4.js} +29 -28
- package/dist/{control-plane-launch-JIQOE6BP.js → control-plane-launch-DBQA3KLJ.js} +8 -8
- package/dist/{docker-KKE5Q5S2.js → docker-YT6Z3LXI.js} +6 -6
- package/dist/{doctor-U2N7AF3N.js → doctor-Y4NCNSJM.js} +181 -34
- package/dist/{emit-artifact-cmd-SDG5H6D7.js → emit-artifact-cmd-ALDK55Y2.js} +11 -11
- package/dist/{emit-cmd-WQH2NK7H.js → emit-cmd-VAQHRWJR.js} +4 -4
- package/dist/{emit-criteria-cmd-QGSP77AG.js → emit-criteria-cmd-Q7SM6VP2.js} +8 -8
- package/dist/{emit-finding-cmd-6FGMTEFM.js → emit-finding-cmd-2NBAPDSV.js} +8 -8
- package/dist/{emit-result-cmd-AUPIXPEU.js → emit-result-cmd-KUSL56RI.js} +11 -11
- package/dist/{emit-step-cmd-PORHEKHN.js → emit-step-cmd-KD4AKEAT.js} +9 -9
- package/dist/{exec-client-J6L5FDRR.js → exec-client-6WVS7DRZ.js} +3 -3
- package/dist/{governing-source-YPBK4H5H.js → governing-source-VVUA5TKB.js} +13 -13
- package/dist/{guest-init-CXIHA5VI.js → guest-init-H5K2RW3P.js} +4 -4
- package/dist/{hook-fast-XMZFMBKC.js → hook-fast-3SUJM765.js} +1 -1
- package/dist/{host-key-GQFBRX3J.js → host-key-XNKZCWTS.js} +3 -3
- package/dist/{image-tag-W4JKVNP4.js → image-tag-R34J4O3F.js} +3 -3
- package/dist/index.js +4 -4
- package/dist/{init-Y64OAKKQ.js → init-3DAGX7UY.js} +30 -29
- package/dist/{init-GEFKJNJU.js → init-SWKYV6CL.js} +29 -28
- package/dist/{init-cmd-YR4LLIRU.js → init-cmd-RIDBVSE4.js} +15 -14
- package/dist/{init-update-46G6QJHB.js → init-update-ECWNG47R.js} +55 -26
- package/dist/{inspect-6UYAAXH7.js → inspect-IPFA7AAT.js} +1 -1
- package/dist/{install-AFMXH25X.js → install-6OIY3KHZ.js} +6 -5
- package/dist/{install-cmd-X5XCUTSX.js → install-cmd-JMT67P35.js} +5 -5
- package/dist/{layout-UOJQGEPW.js → layout-XNFDTOET.js} +2 -2
- package/dist/{logs-PKNQOJN6.js → logs-XHAS6LMZ.js} +2 -2
- package/dist/loop-AIJZVUNA.js +79 -0
- package/dist/{machine-3W4LKTEW.js → machine-OOQ2NXC3.js} +24 -23
- package/dist/machine-skills-FLIRJYP7.js +11 -0
- package/dist/{mcp-serve-cmd-MJIJHSQ6.js → mcp-serve-cmd-LY5A3CE7.js} +4 -4
- package/dist/{paths-6V7572NN.js → paths-LHSPNORF.js} +2 -2
- package/dist/{pending-GUHHKO42.js → pending-3YZCSKON.js} +3 -3
- package/dist/{pidfile-ZQOFDY7T.js → pidfile-DKMYYXLH.js} +3 -3
- package/dist/{record-C4ZVSLKV.js → record-3LPTY3G5.js} +3 -3
- package/dist/{runner-env-6Q2RMENH.js → runner-env-YRRNRKF4.js} +8 -7
- package/dist/{runner-identity-DP577A7S.js → runner-identity-YS2BZXZV.js} +6 -6
- package/dist/{runner-key-LR5P2EJ5.js → runner-key-EFNTZWNX.js} +29 -28
- package/dist/{session-sender-ZTPWIU5L.js → session-sender-SC5PSU2G.js} +12 -12
- package/dist/{spec-cmd-RLZMX67G.js → spec-cmd-JGYHHJ4P.js} +9 -9
- package/dist/{starter-pack-55EFILC5.js → starter-pack-GPU4X6B7.js} +2 -2
- package/dist/{status-GNUOTHRH.js → status-7WM7S7JX.js} +31 -30
- package/dist/{sync-cmd-GLWEAULP.js → sync-cmd-ATXJVS7S.js} +11 -11
- package/dist/{watch-F47NPUDX.js → watch-M7NR3DOW.js} +11 -11
- package/dist/{work-claim-cmd-GXPIRRBG.js → work-claim-cmd-DNUDZKJA.js} +13 -13
- package/dist/{work-cmd-S2FHIFJA.js → work-cmd-VECTYST6.js} +9 -9
- package/dist/{work-comment-cmd-UJRKULO6.js → work-comment-cmd-F3NRWKPZ.js} +9 -9
- package/dist/{work-logs-cmd-SCAHJXSP.js → work-logs-cmd-QF6P32FE.js} +9 -9
- package/dist/{work-open-pr-cmd-BGMHUQGD.js → work-open-pr-cmd-XE23JA3R.js} +10 -10
- package/dist/{work-pr-cmd-EDDRP5DK.js → work-pr-cmd-BH56GUKN.js} +9 -9
- package/dist/{work-stop-cmd-ADE5K6UX.js → work-stop-cmd-C3F5HNUO.js} +9 -9
- 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-F5QWH7G5.js +0 -12
- package/dist/chunk-7RQ73DLO.js +0 -23
- package/dist/loop-3TJKFRN7.js +0 -78
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { keepStagedContext, describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-WSYXLLA5.js';
|
|
4
|
+
import { runnerImageVersion } from './chunk-M3MHHIUW.js';
|
|
5
|
+
import { realFdStorePort } from './chunk-YB3CSYXX.js';
|
|
6
|
+
import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-HWDYLXHH.js';
|
|
5
7
|
import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
|
|
6
8
|
import { currentCliBuild } from './chunk-OGFGZQA3.js';
|
|
7
|
-
import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-
|
|
8
|
-
import { FIRECRACKER_VERSION, hostHelperPinned, firecrackerArch, MICROVM_ARCHES, RecipeError, DOCKER_FEATURE, CLAUDE_CODE_VERSION, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, DEFAULT_BASE_IMAGE } from './chunk-
|
|
9
|
-
import { execCapture } from './chunk-
|
|
10
|
-
import { GUEST_CID } from './chunk-
|
|
11
|
-
import {
|
|
12
|
-
import { WorkCommandError } from './chunk-6CGXSMKX.js';
|
|
9
|
+
import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-EX5MQYEF.js';
|
|
10
|
+
import { FIRECRACKER_VERSION, hostHelperPinned, firecrackerArch, MICROVM_ARCHES, RecipeError, DOCKER_FEATURE, CLAUDE_CODE_VERSION, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, DEFAULT_BASE_IMAGE } from './chunk-2BTFKNTR.js';
|
|
11
|
+
import { execCapture } from './chunk-XBPUTQ7E.js';
|
|
12
|
+
import { GUEST_CID } from './chunk-GLUKDQS4.js';
|
|
13
|
+
import { WorkCommandError } from './chunk-55GNQPO6.js';
|
|
13
14
|
import { hostAllowed } from './chunk-UXYLWVTQ.js';
|
|
14
|
-
import {
|
|
15
|
-
import { sharedSkillNames, skillConflictMessage } from './chunk-
|
|
15
|
+
import { readDu } from './chunk-YJLHUKYS.js';
|
|
16
|
+
import { sharedSkillNames, skillConflictMessage } from './chunk-6TRNCUM4.js';
|
|
16
17
|
import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
|
|
17
18
|
import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-QE3UQAHK.js';
|
|
18
19
|
import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-RKOTJQVG.js';
|
|
19
20
|
import { downconvertSession } from './chunk-QZBXLLTV.js';
|
|
20
|
-
import { vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, SHIM_DIR } from './chunk-
|
|
21
|
-
import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-
|
|
21
|
+
import { vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, SHIM_DIR } from './chunk-RHAGBUL5.js';
|
|
22
|
+
import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-2I3LIRZP.js';
|
|
22
23
|
import { RELAY_USER, RELAY_ID, UNKNOWN_TRANSPORT_REASON, DOCKER_DESKTOP_REASON, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, MAX_OPEN_STREAMS, STREAM_WINDOW, SESSION_WINDOW, targetOfPath } from './chunk-JGD5TWQ2.js';
|
|
23
24
|
import { readFileSync, mkdirSync, existsSync, mkdtempSync, rmSync, chmodSync, truncateSync, writeFileSync, readdirSync, lstatSync, copyFileSync, accessSync, constants, statSync, rmdirSync, renameSync, unlinkSync, openSync, closeSync, createWriteStream, createReadStream } from 'fs';
|
|
24
25
|
import { join, dirname, basename } from 'path';
|
|
@@ -818,6 +819,13 @@ async function createBuildDisk(input) {
|
|
|
818
819
|
function deleteBuildDisk(path) {
|
|
819
820
|
rmSync(path, { force: true });
|
|
820
821
|
}
|
|
822
|
+
var clearBit = (bit) => `0b${"x".repeat(31 - bit)}0${"x".repeat(bit)}`;
|
|
823
|
+
var CPU_TEMPLATE = {
|
|
824
|
+
cpuid_modifiers: [
|
|
825
|
+
{ leaf: "0x1", subleaf: "0x0", flags: 0, modifiers: [{ register: "ecx", bitmap: clearBit(5) }] },
|
|
826
|
+
{ leaf: "0x80000001", subleaf: "0x0", flags: 0, modifiers: [{ register: "ecx", bitmap: clearBit(2) }] }
|
|
827
|
+
]
|
|
828
|
+
};
|
|
821
829
|
var MIB = 1024 ** 2;
|
|
822
830
|
var INIT = "/opt/outerlayer/bin/outerlayer-guest";
|
|
823
831
|
function machineConfig(limits2, paths) {
|
|
@@ -845,7 +853,8 @@ function machineConfig(limits2, paths) {
|
|
|
845
853
|
{ drive_id: "build", path_on_host: paths.buildDisk, is_root_device: false, is_read_only: false }
|
|
846
854
|
],
|
|
847
855
|
"machine-config": { vcpu_count: limits2.cpus, mem_size_mib: Math.max(1, Math.floor(limits2.memoryBytes / MIB)), smt: false },
|
|
848
|
-
vsock: { guest_cid: GUEST_CID, uds_path: paths.vsock }
|
|
856
|
+
vsock: { guest_cid: GUEST_CID, uds_path: paths.vsock },
|
|
857
|
+
"cpu-config": CPU_TEMPLATE
|
|
849
858
|
};
|
|
850
859
|
}
|
|
851
860
|
function firecrackerCommand(input) {
|
|
@@ -910,6 +919,7 @@ function createMicroVmPorts(over = {}) {
|
|
|
910
919
|
firecracker: over.firecracker ?? createFirecrackerHost(),
|
|
911
920
|
cgroup: over.cgroup ?? realCgroupPort(),
|
|
912
921
|
helper: over.helper ?? realHelperPort(),
|
|
922
|
+
fdStore: over.fdStore ?? realFdStorePort(),
|
|
913
923
|
exec: over.exec ?? execCapture
|
|
914
924
|
};
|
|
915
925
|
}
|
|
@@ -2098,6 +2108,9 @@ var V4 = [
|
|
|
2098
2108
|
["private", "10.0.0.0/8"],
|
|
2099
2109
|
["private", "172.16.0.0/12"],
|
|
2100
2110
|
["private", "192.168.0.0/16"],
|
|
2111
|
+
["protocol-assignments", "192.0.0.0/24"],
|
|
2112
|
+
["benchmarking", "198.18.0.0/15"],
|
|
2113
|
+
["azure-wireserver", "168.63.129.16/32"],
|
|
2101
2114
|
["link-local", "169.254.0.0/16"],
|
|
2102
2115
|
["shared-address", "100.64.0.0/10"],
|
|
2103
2116
|
["multicast", "224.0.0.0/4"],
|
|
@@ -2108,6 +2121,8 @@ var V6 = [
|
|
|
2108
2121
|
["loopback", "::1/128"],
|
|
2109
2122
|
["ipv4-mapped", "::ffff:0:0/96"],
|
|
2110
2123
|
["nat64", "64:ff9b::/96"],
|
|
2124
|
+
// The location of an embedded IPv4 address depends on the translator's prefix length, so the whole prefix is refused.
|
|
2125
|
+
["nat64-local", "64:ff9b:1::/48"],
|
|
2111
2126
|
["ipv4-compatible", "::/96"],
|
|
2112
2127
|
["link-local", "fe80::/10"],
|
|
2113
2128
|
["unique-local", "fc00::/7"],
|
|
@@ -2172,6 +2187,12 @@ function build6() {
|
|
|
2172
2187
|
var RANGES_4 = build4();
|
|
2173
2188
|
var RANGES_6 = build6();
|
|
2174
2189
|
[...RANGES_4, ...RANGES_6].map(({ name, cidr }) => ({ name, cidr }));
|
|
2190
|
+
function carried6to4(address) {
|
|
2191
|
+
const v6 = parseV6(address);
|
|
2192
|
+
if (v6 === void 0 || v6 >> BigInt(112) !== BigInt(8194)) return void 0;
|
|
2193
|
+
const v4 = Number(v6 >> BigInt(80) & BigInt(4294967295));
|
|
2194
|
+
return [v4 >>> 24, v4 >>> 16 & 255, v4 >>> 8 & 255, v4 & 255].join(".");
|
|
2195
|
+
}
|
|
2175
2196
|
function classifyAddress(address) {
|
|
2176
2197
|
const v4 = parseV4(address);
|
|
2177
2198
|
if (v4 !== void 0) {
|
|
@@ -2183,6 +2204,11 @@ function classifyAddress(address) {
|
|
|
2183
2204
|
}
|
|
2184
2205
|
const v6 = parseV6(address);
|
|
2185
2206
|
if (v6 === void 0) return UNPARSEABLE;
|
|
2207
|
+
const carries = carried6to4(address);
|
|
2208
|
+
if (carries !== void 0) {
|
|
2209
|
+
const inner = classifyAddress(carries);
|
|
2210
|
+
return inner === void 0 ? void 0 : { ...inner, carries };
|
|
2211
|
+
}
|
|
2186
2212
|
for (const range of RANGES_6) {
|
|
2187
2213
|
const shift = BigInt(128 - range.bits);
|
|
2188
2214
|
if (v6 >> shift === range.base >> shift) return { name: range.name, cidr: range.cidr };
|
|
@@ -2317,13 +2343,15 @@ async function startTunnel(socketPath, opts = {}) {
|
|
|
2317
2343
|
const own = new Set(ownAddresses().map(normalize));
|
|
2318
2344
|
let firstRefusal;
|
|
2319
2345
|
for (const { address: address2 } of addresses) {
|
|
2320
|
-
const
|
|
2346
|
+
const carried = carried6to4(address2);
|
|
2347
|
+
const range = own.has(normalize(address2)) || carried !== void 0 && own.has(carried) ? { name: "host-address", cidr: address2, ...carried === void 0 ? {} : { carries: carried } } : classifyAddress(address2);
|
|
2321
2348
|
if (range === void 0) return { ok: true, address: address2 };
|
|
2322
|
-
firstRefusal ??= { address: address2, name: range.name, cidr: range.cidr };
|
|
2349
|
+
firstRefusal ??= { address: address2, name: range.name, cidr: range.cidr, carries: range.carries };
|
|
2323
2350
|
}
|
|
2324
|
-
const { address, name, cidr } = firstRefusal;
|
|
2351
|
+
const { address, name, cidr, carries } = firstRefusal;
|
|
2325
2352
|
refused2(host, address, name);
|
|
2326
|
-
|
|
2353
|
+
const via = carries === void 0 ? "" : `, which carries ${carries}`;
|
|
2354
|
+
return { ok: false, status: 403, body: `refused: ${host} is ${address}${via}, in the ${name} range ${cidr}
|
|
2327
2355
|
` };
|
|
2328
2356
|
}
|
|
2329
2357
|
const sockets = /* @__PURE__ */ new Set();
|
|
@@ -2440,12 +2468,16 @@ ${body}`);
|
|
|
2440
2468
|
req.pipe(upstream);
|
|
2441
2469
|
}
|
|
2442
2470
|
if (opts.socket !== false) {
|
|
2443
|
-
if (
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2471
|
+
if (opts.listenOn !== void 0) {
|
|
2472
|
+
await opts.listenOn(server);
|
|
2473
|
+
} else {
|
|
2474
|
+
if (existsSync(socketPath)) unlinkSync(socketPath);
|
|
2475
|
+
await new Promise((resolveListen, reject) => {
|
|
2476
|
+
server.once("error", reject);
|
|
2477
|
+
server.listen(socketPath, () => resolveListen());
|
|
2478
|
+
});
|
|
2479
|
+
chmodSync(socketPath, 438);
|
|
2480
|
+
}
|
|
2449
2481
|
}
|
|
2450
2482
|
const tcpServers = [];
|
|
2451
2483
|
return {
|
|
@@ -2453,6 +2485,7 @@ ${body}`);
|
|
|
2453
2485
|
record,
|
|
2454
2486
|
destinationUsed,
|
|
2455
2487
|
acceptStream: (stream) => void server.emit("connection", stream),
|
|
2488
|
+
listener: () => opts.socket === false ? void 0 : server,
|
|
2456
2489
|
async listenTcp(address) {
|
|
2457
2490
|
const tcp = createServer$1((socket) => server.emit("connection", socket));
|
|
2458
2491
|
await new Promise((resolveListen, reject) => {
|
|
@@ -2981,16 +3014,28 @@ async function stopContainer(runtime, state) {
|
|
|
2981
3014
|
await runtime.host.stop(state.container);
|
|
2982
3015
|
state.stopped = true;
|
|
2983
3016
|
}
|
|
3017
|
+
var DISK_CHECK_MS = 12e4;
|
|
2984
3018
|
async function measureDisk(runtime, state) {
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
env: NO_ENV,
|
|
2989
|
-
argv: ["du", "-skx", "/build"]
|
|
3019
|
+
let timer;
|
|
3020
|
+
const late = new Promise((resolve) => {
|
|
3021
|
+
timer = setTimeout(() => resolve({ failure: "du ran past 2 minutes" }), DISK_CHECK_MS);
|
|
2990
3022
|
});
|
|
2991
|
-
|
|
3023
|
+
try {
|
|
3024
|
+
const run = runtime.host.exec(
|
|
3025
|
+
{
|
|
3026
|
+
container: state.container,
|
|
3027
|
+
user: state.agentUser ?? ADDED_USER,
|
|
3028
|
+
env: { literals: { LC_ALL: "C" }, passed: {} },
|
|
3029
|
+
argv: ["du", "-skx", "/build"]
|
|
3030
|
+
},
|
|
3031
|
+
{ timeoutMs: DISK_CHECK_MS + 1e4 }
|
|
3032
|
+
).then(readDu, (err) => ({ failure: `docker exec did not run: ${err instanceof Error ? err.message.slice(0, 200) : "unknown error"}` }));
|
|
3033
|
+
return await Promise.race([run, late]);
|
|
3034
|
+
} finally {
|
|
3035
|
+
clearTimeout(timer);
|
|
3036
|
+
}
|
|
2992
3037
|
}
|
|
2993
|
-
async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, builtIns, gitRemote, serve = "socket", lease) {
|
|
3038
|
+
async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, builtIns, gitRemote, serve = "socket", lease, inherit) {
|
|
2994
3039
|
return startBuildServices({
|
|
2995
3040
|
startTunnel: runtime.startTunnel,
|
|
2996
3041
|
tunnelOptions: { ...runtime.tunnelOptions, ...gitRemote === void 0 ? {} : { gitRemote } },
|
|
@@ -3000,6 +3045,7 @@ async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, bui
|
|
|
3000
3045
|
allowHosts: config.build?.allowHosts,
|
|
3001
3046
|
serve,
|
|
3002
3047
|
...lease === void 0 ? {} : { lease },
|
|
3048
|
+
...inherit === void 0 ? {} : { inherit },
|
|
3003
3049
|
...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream } } : {},
|
|
3004
3050
|
hostEnv: runtime.hostEnv,
|
|
3005
3051
|
destinationOptions: runtime.destinationOptions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-RHAGBUL5.js';
|
|
4
4
|
import { readFileSync, existsSync, rmSync, mkdirSync, writeFileSync, renameSync } from 'fs';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
@@ -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,11 +1,11 @@
|
|
|
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';
|
|
@@ -18,7 +18,7 @@ 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';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { WorkCommandError, postJson } from './chunk-
|
|
4
|
-
import { defaultGitRunner, materializeContext, isStagingWriteFault, lookupGoverningSource } from './chunk-
|
|
5
|
-
import { signingFetchFor } from './chunk-
|
|
6
|
-
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-
|
|
3
|
+
import { WorkCommandError, postJson } from './chunk-55GNQPO6.js';
|
|
4
|
+
import { defaultGitRunner, materializeContext, isStagingWriteFault, lookupGoverningSource } from './chunk-BPKO76QR.js';
|
|
5
|
+
import { signingFetchFor } from './chunk-BWH36FOC.js';
|
|
6
|
+
import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-6TRNCUM4.js';
|
|
7
7
|
import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
8
8
|
import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
|
|
9
|
-
import { signerFor } from './chunk-
|
|
10
|
-
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-
|
|
9
|
+
import { signerFor } from './chunk-Y4OKEFAX.js';
|
|
10
|
+
import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-RHAGBUL5.js';
|
|
11
11
|
import { fstatSync, mkdirSync, writeFileSync, chmodSync, rmSync, cpSync, readFileSync, existsSync, lstatSync } from 'fs';
|
|
12
12
|
import { relative, join, dirname } from 'path';
|
|
13
13
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import {
|
|
3
|
+
import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-LOKSLO25.js';
|
|
4
|
+
import { retiredSkillPaths, removeRetiredSkills } from './chunk-MHX7YX7Y.js';
|
|
5
|
+
import { maintainedFilesForExistingSkills, loadMaintainedFiles, writeMaintainedFiles } from './chunk-7OUOLGUV.js';
|
|
4
6
|
import { C } from './chunk-ANPNT6PM.js';
|
|
5
|
-
import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-JKNYTNYD.js';
|
|
6
|
-
import { maintainedFilesForExistingSkills, loadMaintainedFiles, writeMaintainedFiles } from './chunk-HBISTTG3.js';
|
|
7
7
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
8
8
|
import { emitTree, generatedHeaderSource, parseOuterlayerConfig, classifyTree } from './chunk-RKOTJQVG.js';
|
|
9
9
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, copyFileSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { RELAY_PORT, BUILD_HOME } from './chunk-
|
|
3
|
+
import { RELAY_PORT, BUILD_HOME } from './chunk-2I3LIRZP.js';
|
|
4
4
|
import { createServer, connect } from 'net';
|
|
5
5
|
|
|
6
6
|
createRequire(import.meta.url);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
+
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MAINTAINED_SKILLS, MACHINE_SKILL_PATH } from './chunk-7OUOLGUV.js';
|
|
3
4
|
import { C } from './chunk-ANPNT6PM.js';
|
|
4
|
-
import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MAINTAINED_SKILLS } from './chunk-HBISTTG3.js';
|
|
5
5
|
import { cliInvocation } from './chunk-CRB3POP4.js';
|
|
6
6
|
import { linkedAgentsPath } from './chunk-VWFOKRYS.js';
|
|
7
7
|
import { resolvePackageVersion } from './chunk-RA3O54FC.js';
|
|
@@ -31,7 +31,7 @@ function installStarterPack(opts) {
|
|
|
31
31
|
const linked = base.startsWith(".agents/") ? linkedAgentsPath(opts.repoRoot) : void 0;
|
|
32
32
|
if (linked !== void 0) throw new StarterPackError(`${linked} is a link, and a write there would land outside the repository; replace it with a folder and run this again`);
|
|
33
33
|
const templateFiles = loadTemplateFiles(packRoot, version, base);
|
|
34
|
-
const maintainedFiles = loadMaintainedFiles(packRoot, version, base);
|
|
34
|
+
const maintainedFiles = base === AGENTS_SKILLS_BASE ? [] : loadMaintainedFiles(packRoot, version, base);
|
|
35
35
|
const validatorFiles = VALIDATOR_FILES.map(({ name }) => ({
|
|
36
36
|
path: `${VALIDATORS_DIR}/${name}`,
|
|
37
37
|
content: rewriteSkillPaths(readFileSync(join(packRoot, "validators", name), "utf8"), base)
|
|
@@ -94,9 +94,13 @@ function formatStarterPackOutput(result) {
|
|
|
94
94
|
result.kept.includes(skill) ? ` ${C.dim}kept${C.reset} ${skillDir(skill, base)}/ ${C.dim}(already exists, left exactly as it is)${C.reset}` : ` ${skillFile(skill, base)}`
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
97
|
+
if (base === OUTERLAYER_SKILLS_BASE) {
|
|
98
|
+
lines.push("", "Rewritten on every emit \u2014 edits are overwritten by the installed CLI:");
|
|
99
|
+
for (const skill of MAINTAINED_SKILLS) lines.push(` ${skillFile(skill, base)}`);
|
|
100
|
+
} else {
|
|
101
|
+
lines.push("", `Kept once per machine, not in this repository. \`${cliInvocation()} init\` installs them, and every later command keeps them at its own version:`);
|
|
102
|
+
for (const skill of MAINTAINED_SKILLS) lines.push(` ${skillFile(skill, MACHINE_SKILL_PATH)}`);
|
|
103
|
+
}
|
|
100
104
|
lines.push(
|
|
101
105
|
"",
|
|
102
106
|
result.policy === "written" ? `${C.green}\u2713${C.reset} Wrote ${POLICY_PATH} (review required)` : `${C.dim}${POLICY_PATH} already exists \u2014 left as it is${C.reset}`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-
|
|
3
|
+
import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-RHAGBUL5.js';
|
|
4
4
|
import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
|
|
5
5
|
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { LiveUploader } from './chunk-
|
|
4
|
-
import { spoolDir } from './chunk-
|
|
3
|
+
import { LiveUploader } from './chunk-VS27BP3E.js';
|
|
4
|
+
import { spoolDir } from './chunk-DJHNEGNM.js';
|
|
5
5
|
import { CaptureDaemon } from './chunk-QE3UQAHK.js';
|
|
6
6
|
import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
|
|
7
7
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
|
|
5
|
+
createRequire(import.meta.url);
|
|
6
|
+
var FD_STORE_ENV = "OUTERLAYER_FD_STORE";
|
|
7
|
+
var MIN_SYSTEMD = 254;
|
|
8
|
+
var LISTEN_FDS_START = 3;
|
|
9
|
+
var FD_SLOTS_PER_BUILD = 64;
|
|
10
|
+
function fdName(buildId, socket) {
|
|
11
|
+
return `ol-${buildId}-${socket}`;
|
|
12
|
+
}
|
|
13
|
+
function listenFdOf(server) {
|
|
14
|
+
const handle = server._handle;
|
|
15
|
+
return typeof handle?.fd === "number" && handle.fd >= 0 ? handle.fd : void 0;
|
|
16
|
+
}
|
|
17
|
+
function parseListenFds(env, pid) {
|
|
18
|
+
const found = /* @__PURE__ */ new Map();
|
|
19
|
+
if (env.LISTEN_PID !== String(pid)) return found;
|
|
20
|
+
const count = Number(env.LISTEN_FDS);
|
|
21
|
+
if (!Number.isInteger(count) || count <= 0) return found;
|
|
22
|
+
const names = (env.LISTEN_FDNAMES ?? "").split(":");
|
|
23
|
+
for (let index = 0; index < count; index++) {
|
|
24
|
+
const name = names[index];
|
|
25
|
+
if (name !== void 0 && name !== "" && name !== "stored") found.set(name, LISTEN_FDS_START + index);
|
|
26
|
+
}
|
|
27
|
+
return found;
|
|
28
|
+
}
|
|
29
|
+
function listenOnFd(server, fd) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
server.once("error", reject);
|
|
32
|
+
server.listen({ fd }, () => {
|
|
33
|
+
server.off("error", reject);
|
|
34
|
+
resolve();
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function run(spawnFn, command, args, fd) {
|
|
39
|
+
return new Promise((resolve) => {
|
|
40
|
+
let stdout = "";
|
|
41
|
+
let stderr = "";
|
|
42
|
+
let child;
|
|
43
|
+
try {
|
|
44
|
+
child = spawnFn(command, args, { stdio: ["ignore", "pipe", "pipe", ...fd === void 0 ? [] : [fd]] });
|
|
45
|
+
} catch (err) {
|
|
46
|
+
resolve({ status: null, stdout, stderr: err instanceof Error ? err.message : String(err) });
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
child.stdout?.on("data", (chunk) => stdout += chunk.toString("utf8"));
|
|
50
|
+
child.stderr?.on("data", (chunk) => stderr += chunk.toString("utf8"));
|
|
51
|
+
child.on("error", (err) => resolve({ status: null, stdout, stderr: err.message }));
|
|
52
|
+
child.on("close", (status) => resolve({ status, stdout, stderr }));
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function systemdVersion(ran) {
|
|
56
|
+
const match = /^systemd (\d+)/.exec(ran.stdout);
|
|
57
|
+
return ran.status === 0 && match !== null ? Number(match[1]) : void 0;
|
|
58
|
+
}
|
|
59
|
+
function realFdStorePort(options = {}) {
|
|
60
|
+
const env = options.env ?? process.env;
|
|
61
|
+
const pid = options.pid ?? process.pid;
|
|
62
|
+
const command = options.command ?? "systemd-notify";
|
|
63
|
+
const spawnFn = options.spawn ?? spawn;
|
|
64
|
+
let inherited;
|
|
65
|
+
let version;
|
|
66
|
+
return {
|
|
67
|
+
async status() {
|
|
68
|
+
if (env.NOTIFY_SOCKET === void 0 || env.NOTIFY_SOCKET === "") return { ok: false, reason: "NOTIFY_SOCKET is not set, so this runner was not started by a service that accepts descriptors" };
|
|
69
|
+
const size = Number(env[FD_STORE_ENV]);
|
|
70
|
+
if (!Number.isInteger(size) || size <= 0) return { ok: false, reason: `${FD_STORE_ENV} is not set, so the service's unit keeps no descriptor store` };
|
|
71
|
+
version ??= run(spawnFn, command, ["--version"]).then(systemdVersion);
|
|
72
|
+
const found = await version;
|
|
73
|
+
if (found === void 0) return { ok: false, reason: `${command} could not be run, so no descriptor can be stored` };
|
|
74
|
+
if (found < MIN_SYSTEMD) return { ok: false, reason: `systemd ${found} cannot store a descriptor sent from a child process: it needs systemd ${MIN_SYSTEMD} or later` };
|
|
75
|
+
return { ok: true };
|
|
76
|
+
},
|
|
77
|
+
async push(name, server) {
|
|
78
|
+
const fd = listenFdOf(server);
|
|
79
|
+
if (fd === void 0) throw new Error(`${name} has no descriptor to store`);
|
|
80
|
+
const ran = await run(spawnFn, command, [`--fd=${LISTEN_FDS_START}`, `--fdname=${name}`, "FDSTORE=1"], fd);
|
|
81
|
+
if (ran.status !== 0) throw new Error(`storing ${name} failed${ran.status === null ? "" : ` (exit ${ran.status})`}: ${ran.stderr.trim().split("\n")[0] ?? ""}`);
|
|
82
|
+
},
|
|
83
|
+
async remove(name) {
|
|
84
|
+
const ran = await run(spawnFn, command, [`--fdname=${name}`, "FDSTOREREMOVE=1"]);
|
|
85
|
+
if (ran.status !== 0) throw new Error(`removing ${name} from the store failed${ran.status === null ? "" : ` (exit ${ran.status})`}: ${ran.stderr.trim().split("\n")[0] ?? ""}`);
|
|
86
|
+
},
|
|
87
|
+
inherited() {
|
|
88
|
+
inherited ??= parseListenFds(env, pid);
|
|
89
|
+
return inherited;
|
|
90
|
+
},
|
|
91
|
+
listenOn: listenOnFd
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { FD_SLOTS_PER_BUILD, FD_STORE_ENV, fdName, realFdStorePort };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
|
|
4
|
+
createRequire(import.meta.url);
|
|
5
|
+
|
|
6
|
+
// src/runner/container/disk.ts
|
|
7
|
+
var UNITS = { "": 1, k: 1024, m: 1024 ** 2, g: 1024 ** 3 };
|
|
8
|
+
function parseSize(text) {
|
|
9
|
+
const match = /^(\d+(?:\.\d+)?)([kKmMgG]?)$/.exec(text);
|
|
10
|
+
if (match === null) return void 0;
|
|
11
|
+
const bytes = Number(match[1]) * UNITS[match[2].toLowerCase()];
|
|
12
|
+
return bytes > 0 ? bytes : void 0;
|
|
13
|
+
}
|
|
14
|
+
function exceedsDisk(usedKilobytes, limit) {
|
|
15
|
+
const bytes = parseSize(limit);
|
|
16
|
+
return usedKilobytes * 1024 > (bytes ?? Number.POSITIVE_INFINITY);
|
|
17
|
+
}
|
|
18
|
+
var TOTAL = /^(\d+)\t\/build$/;
|
|
19
|
+
var GONE = /: No such file or directory$/;
|
|
20
|
+
var LINE_MAX = 200;
|
|
21
|
+
function readDu(result) {
|
|
22
|
+
const stdoutLines = result.stdout.split("\n");
|
|
23
|
+
const totalAt = stdoutLines.map((line) => TOTAL.test(line)).lastIndexOf(true);
|
|
24
|
+
const kib = totalAt === -1 ? void 0 : Number(TOTAL.exec(stdoutLines[totalAt])[1]);
|
|
25
|
+
const lines = [...result.stderr.split("\n"), ...stdoutLines.filter((_, index) => index !== totalAt)].map((line) => line.trim()).filter((line) => line !== "");
|
|
26
|
+
const other = lines.find((line) => !GONE.test(line));
|
|
27
|
+
if (kib !== void 0 && result.status === 0) return { kib };
|
|
28
|
+
if (kib !== void 0 && other === void 0 && lines.length > 0) return { kib };
|
|
29
|
+
const detail = other === void 0 ? "" : `: ${cut(other.replace(/[\u0000-\u001f\u007f]/g, " "))}`;
|
|
30
|
+
return { ...kib === void 0 ? {} : { kib }, failure: `docker exec exited ${result.status}${detail}` };
|
|
31
|
+
}
|
|
32
|
+
function cut(line) {
|
|
33
|
+
const head = line.slice(0, LINE_MAX);
|
|
34
|
+
const last = head.charCodeAt(head.length - 1);
|
|
35
|
+
return last >= 55296 && last <= 56319 ? head.slice(0, -1) : head;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { exceedsDisk, parseSize, readDu };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { isPlaceholderCommand } from './chunk-
|
|
4
|
-
import { describeCallFailure } from './chunk-
|
|
5
|
-
import { WorkCommandError, getJson } from './chunk-
|
|
3
|
+
import { isPlaceholderCommand } from './chunk-64GMBWAK.js';
|
|
4
|
+
import { describeCallFailure } from './chunk-WSYXLLA5.js';
|
|
5
|
+
import { WorkCommandError, getJson } from './chunk-55GNQPO6.js';
|
|
6
6
|
import { sanitizeTerminal } from './chunk-BUP5N3X6.js';
|
|
7
|
-
import { builtinKind } from './chunk-
|
|
8
|
-
import { signerFor } from './chunk-
|
|
9
|
-
import { CLAUDE_CREDENTIAL_VARIABLES, claudeCredential } from './chunk-
|
|
7
|
+
import { builtinKind } from './chunk-EPPIISRD.js';
|
|
8
|
+
import { signerFor } from './chunk-Y4OKEFAX.js';
|
|
9
|
+
import { CLAUDE_CREDENTIAL_VARIABLES, claudeCredential } from './chunk-2I3LIRZP.js';
|
|
10
10
|
|
|
11
11
|
createRequire(import.meta.url);
|
|
12
12
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { sharedSkillNames } from './chunk-
|
|
3
|
+
import { sharedSkillNames } from './chunk-6TRNCUM4.js';
|
|
4
4
|
import { GOVERNANCE_VARIABLE, versionAtLeast, MINIMUM_CLAUDE_VERSION, SHIM_SCRIPT, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
|
|
5
5
|
export { MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
|
|
6
6
|
import { findGitDirs } from './chunk-BJ3KTMDH.js';
|
|
7
|
-
import './chunk-
|
|
7
|
+
import { setupMachineSkills } from './chunk-IMOB4IOI.js';
|
|
8
|
+
import './chunk-7OUOLGUV.js';
|
|
8
9
|
import './chunk-RKOTJQVG.js';
|
|
9
10
|
import './chunk-QZBXLLTV.js';
|
|
10
11
|
import { homeFromEnv } from './chunk-VNVZDWO3.js';
|
|
@@ -210,12 +211,15 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
210
211
|
const cwd = deps.cwd ?? process.cwd();
|
|
211
212
|
const env = deps.env ?? process.env;
|
|
212
213
|
const stderr = deps.stderr ?? ((text) => void process.stderr.write(text));
|
|
214
|
+
const home = homeFromEnv(env);
|
|
215
|
+
const installed = setupMachineSkills(home);
|
|
216
|
+
for (const failure of installed.failures) stderr(`outerlayer claude: could not write a maintained skill: ${failure}
|
|
217
|
+
`);
|
|
213
218
|
const claude = findClaude(env.PATH);
|
|
214
219
|
if (claude === void 0) {
|
|
215
220
|
stderr("outerlayer claude: no claude program found on PATH\n");
|
|
216
221
|
return 127;
|
|
217
222
|
}
|
|
218
|
-
const home = homeFromEnv(env);
|
|
219
223
|
try {
|
|
220
224
|
removeStaleOwnSkillsDirs(home);
|
|
221
225
|
} catch {
|
|
@@ -236,7 +240,7 @@ async function runClaudeLauncher(args, deps = {}) {
|
|
|
236
240
|
return 1;
|
|
237
241
|
}
|
|
238
242
|
} else {
|
|
239
|
-
const { resolveLaunchPlane } = await import('./control-plane-launch-
|
|
243
|
+
const { resolveLaunchPlane } = await import('./control-plane-launch-DBQA3KLJ.js');
|
|
240
244
|
const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
|
|
241
245
|
if (plane.kind === "none") {
|
|
242
246
|
const own2 = ownSkillsDirFor(cwd, home, [], stderr);
|