@outerlayer/cli 0.34.0-next.20261025180645 → 0.34.0-next.20261025224117
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-info.json +1 -1
- package/dist/{check-QULEN437.js → check-YOSEXQPQ.js} +6 -6
- package/dist/{chunk-O4Z2MNNL.js → chunk-6P4YL4CO.js} +1 -1
- package/dist/{chunk-FD5ASWTG.js → chunk-DJO6GI7B.js} +1 -1
- package/dist/{chunk-LUHIN4UZ.js → chunk-GC5PVMIJ.js} +85 -17
- package/dist/{chunk-VJ34F55N.js → chunk-RLPIRL33.js} +6 -6
- package/dist/{chunk-DNZYXEMY.js → chunk-SMWRIAGH.js} +1 -1
- package/dist/{chunk-RHV5SRI2.js → chunk-XJXBQQR4.js} +1 -1
- package/dist/{chunk-HHFZXOBC.js → chunk-YV7BP62T.js} +1 -1
- package/dist/{chunk-JQSZTQSK.js → chunk-ZVGSCE2Q.js} +28 -5
- package/dist/{cli-G3P2B2XE.js → cli-NKT5FAP3.js} +22 -22
- package/dist/{command-4XOXVWFW.js → command-BC2NOUA5.js} +32 -17
- package/dist/{container-start-2DHCWV73.js → container-start-3GFLLV4Q.js} +4 -4
- package/dist/{doctor-LK6E3XOW.js → doctor-Z4OA5JJK.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{init-FAIF7KOK.js → init-3KP2CDZJ.js} +1 -1
- package/dist/{init-2CEULE3F.js → init-43LJRRQO.js} +1 -1
- package/dist/{init-cmd-HZUUMO45.js → init-cmd-FN7CSVLZ.js} +1 -1
- package/dist/{install-cmd-TWGRGEVL.js → install-cmd-5H6M2KJ7.js} +1 -1
- package/dist/{loop-7U7MVICV.js → loop-5MVKWHNV.js} +6 -6
- package/dist/{machine-S3JHOX4V.js → machine-APH6CXPC.js} +1 -1
- package/dist/{runner-key-CYSUYKSX.js → runner-key-WY6KFIRA.js} +1 -1
- package/dist/{status-2AP7J2L7.js → status-U3Y6HJJI.js} +2 -2
- package/dist/{update-steps-JQOCCDWO.js → update-steps-ROLDDTPM.js} +3 -3
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"2026-10-
|
|
1
|
+
{"id":"2026-10-25T22:42:26.292Z+d165ee3","root":"/home/runner/_work/outerlayer/outerlayer","pkg":"outerlayer"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { probeCredentials } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import { probeCredentials } from './chunk-RLPIRL33.js';
|
|
4
|
+
import './chunk-6P4YL4CO.js';
|
|
5
5
|
import './chunk-TFPNPS4Q.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-XJXBQQR4.js';
|
|
7
|
+
import './chunk-DJO6GI7B.js';
|
|
8
8
|
import './chunk-ZVB57WI6.js';
|
|
9
9
|
import './chunk-FDJPDZSR.js';
|
|
10
10
|
import './chunk-3JVYMD4G.js';
|
|
@@ -17,11 +17,11 @@ import './chunk-QANM5COC.js';
|
|
|
17
17
|
import './chunk-EGVHFHY4.js';
|
|
18
18
|
import './chunk-ESVW4MJY.js';
|
|
19
19
|
import './chunk-SI6WDF3U.js';
|
|
20
|
-
import { managedProblems, managedFactsOf } from './chunk-
|
|
20
|
+
import { managedProblems, managedFactsOf } from './chunk-SMWRIAGH.js';
|
|
21
21
|
import './chunk-UMYYYF7B.js';
|
|
22
22
|
import './chunk-TBT347UY.js';
|
|
23
23
|
import { findServiceUnit } from './chunk-SUOZYOWO.js';
|
|
24
|
-
import { placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, HELPER_ENV, helperSocketPath, probeHelper, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem, formerSkillQueues, formerSkillProblem } from './chunk-
|
|
24
|
+
import { placeholderQueues, placeholderProblem, permissionModeProblems, permissionModeProblem, HELPER_ENV, helperSocketPath, probeHelper, needsClaudeCredential, claudeCredentialCheck, claimPermissionProblem, formerSkillQueues, formerSkillProblem } from './chunk-ZVGSCE2Q.js';
|
|
25
25
|
import './chunk-2PGI6RDE.js';
|
|
26
26
|
import './chunk-UO4FQAOX.js';
|
|
27
27
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { scrubReason, stripTerminalControls } from './chunk-
|
|
3
|
+
import { scrubReason, stripTerminalControls } from './chunk-DJO6GI7B.js';
|
|
4
4
|
import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-INOUUSYI.js';
|
|
5
5
|
import { RunnerAlreadyRunningError, readPidFile } from './chunk-YNMVVQOQ.js';
|
|
6
6
|
import { isSameProcess } from './chunk-JBJTC3UU.js';
|
|
@@ -6,7 +6,7 @@ import { zodProblem } from './chunk-I3LTIAOR.js';
|
|
|
6
6
|
import { senderPidfile } from './chunk-JBCOUY4M.js';
|
|
7
7
|
import { installScrubContext } from './chunk-QANM5COC.js';
|
|
8
8
|
import { writeDockerClientConfig } from './chunk-SI6WDF3U.js';
|
|
9
|
-
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, hasClaudeCredential, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, managedClaudeKeyValues, stopJailed, deleteBuildDisk, managedClaudeKeyFor, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-
|
|
9
|
+
import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, hasClaudeCredential, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, managedClaudeKeyValues, stopJailed, deleteBuildDisk, managedClaudeKeyFor, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-ZVGSCE2Q.js';
|
|
10
10
|
import { readBranchHead, fetchCommit, diffBetween } from './chunk-UO4FQAOX.js';
|
|
11
11
|
import { waitForAgent, vmExecArgs } from './chunk-2ILU7UAU.js';
|
|
12
12
|
import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-OGPEHSNW.js';
|
|
@@ -1,13 +1,67 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { launcherPath, writeLauncher, LauncherWriteError
|
|
4
|
-
import { currentVersion, currentLink,
|
|
3
|
+
import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-OS7DJOQJ.js';
|
|
4
|
+
import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-UMYYYF7B.js';
|
|
5
5
|
import { compareVersions } from './chunk-TQMI335S.js';
|
|
6
|
-
import { RUNNER_DIR_MODE } from './chunk-PXGU3GKY.js';
|
|
7
|
-
import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
|
|
6
|
+
import { runnerDir, RUNNER_DIR_MODE } from './chunk-PXGU3GKY.js';
|
|
7
|
+
import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
|
|
8
8
|
import { dirname, sep, join } from 'path';
|
|
9
|
+
import { spawnSync } from 'child_process';
|
|
10
|
+
import { userInfo } from 'os';
|
|
9
11
|
|
|
10
12
|
createRequire(import.meta.url);
|
|
13
|
+
function idOf(flag, account) {
|
|
14
|
+
const result = spawnSync("id", [flag, account], { encoding: "utf8" });
|
|
15
|
+
const id = Number(result.stdout);
|
|
16
|
+
return result.status === 0 && result.stdout.trim() !== "" && Number.isInteger(id) ? id : void 0;
|
|
17
|
+
}
|
|
18
|
+
function accountIdentity(account) {
|
|
19
|
+
const self = userInfo();
|
|
20
|
+
const uid = account === self.username ? self.uid : idOf("-u", account);
|
|
21
|
+
const gid = account === self.username ? self.gid : idOf("-g", account);
|
|
22
|
+
return uid === void 0 || gid === void 0 || uid < 0 || gid < 0 ? void 0 : { uid, gid };
|
|
23
|
+
}
|
|
24
|
+
function realOwnership() {
|
|
25
|
+
return {
|
|
26
|
+
uid: () => process.getuid?.(),
|
|
27
|
+
ownerOf: (path) => {
|
|
28
|
+
const info = lstatSync(path, { throwIfNoEntry: false });
|
|
29
|
+
return info === void 0 ? void 0 : { uid: info.uid, gid: info.gid };
|
|
30
|
+
},
|
|
31
|
+
identity: accountIdentity,
|
|
32
|
+
lchown: (path, owner) => lchownSync(path, owner.uid, owner.gid)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function forAnother(find, deps) {
|
|
36
|
+
if (deps.uid() !== 0) return void 0;
|
|
37
|
+
const owner = find();
|
|
38
|
+
return owner !== void 0 && owner.uid !== 0 ? owner : void 0;
|
|
39
|
+
}
|
|
40
|
+
function accountNamed(account, deps) {
|
|
41
|
+
return forAnother(() => deps.identity(account), deps);
|
|
42
|
+
}
|
|
43
|
+
function accountOwning(dir, deps) {
|
|
44
|
+
return forAnother(() => deps.ownerOf(dir), deps);
|
|
45
|
+
}
|
|
46
|
+
function handOver(owner, paths, deps) {
|
|
47
|
+
if (owner === void 0) return void 0;
|
|
48
|
+
const give = (path, tree) => {
|
|
49
|
+
const info = lstatSync(path, { throwIfNoEntry: false });
|
|
50
|
+
if (info === void 0) return;
|
|
51
|
+
deps.lchown(path, owner);
|
|
52
|
+
if (tree && info.isDirectory()) for (const name of readdirSync(path)) give(join(path, name), true);
|
|
53
|
+
};
|
|
54
|
+
for (const entry of paths) {
|
|
55
|
+
try {
|
|
56
|
+
give(entry.path, entry.tree === true);
|
|
57
|
+
} catch (err) {
|
|
58
|
+
return `${entry.path} could not be given to user id ${owner.uid}, the account the runner runs as (${err instanceof Error ? err.message : String(err)}): run \`chown -hR ${owner.uid}:${owner.gid} ${entry.path}\` as root`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/runner/update/install-cmd.ts
|
|
11
65
|
var RunnerInstallError = class extends Error {
|
|
12
66
|
};
|
|
13
67
|
var RunnerDowngradeError = class extends RunnerInstallError {
|
|
@@ -42,20 +96,17 @@ function runRunnerInstall(args) {
|
|
|
42
96
|
`this CLI is ${version}, older than ${installed}, the version the runner runs from ${currentLink(configPath)}. Installing it would move the runner back to ${version}. Run \`${launcherPath(args.home)} ${command}\` instead, which runs ${installed}. To install ${version} anyway, run \`outerlayer ${command} --allow-downgrade\``
|
|
43
97
|
);
|
|
44
98
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
rmSync(target, { recursive: true, force: true });
|
|
49
|
-
cpSync(packageRoot, target, { recursive: true });
|
|
50
|
-
carryHoistedDevcontainerCli(packageRoot, target);
|
|
51
|
-
}
|
|
52
|
-
switchCurrent(configPath, version);
|
|
99
|
+
const ownership = args.ownership ?? realOwnership();
|
|
100
|
+
const account = args.account === void 0 ? accountOwning(dirname(configPath), ownership) : accountNamed(args.account, ownership);
|
|
101
|
+
const homeAccount = accountOwning(args.home, ownership);
|
|
53
102
|
let written;
|
|
54
103
|
try {
|
|
55
|
-
written =
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
104
|
+
written = placeInLayout({ configPath, nodePath, home: args.home, replace: args.replace, entry, packageRoot, version });
|
|
105
|
+
} finally {
|
|
106
|
+
const launcher = launcherPath(args.home);
|
|
107
|
+
const problem = handOver(account, [{ path: runnerDir(configPath) }, { path: dirname(versionDir(configPath, version)) }, { path: versionDir(configPath, version), tree: true }, { path: currentLink(configPath) }], ownership) ?? // A launcher file the runner did not write stays with its owner.
|
|
108
|
+
handOver(homeAccount, [{ path: join(args.home, ".local") }, { path: dirname(launcher) }, ...written === void 0 || written.state === "foreign" ? [] : [{ path: launcher }]], ownership);
|
|
109
|
+
if (problem !== void 0 && written !== void 0) throw new RunnerInstallError(problem);
|
|
59
110
|
}
|
|
60
111
|
return {
|
|
61
112
|
version,
|
|
@@ -69,6 +120,23 @@ function runRunnerInstall(args) {
|
|
|
69
120
|
}
|
|
70
121
|
};
|
|
71
122
|
}
|
|
123
|
+
function placeInLayout(input) {
|
|
124
|
+
const { configPath, packageRoot, version } = input;
|
|
125
|
+
if (!isInLayout(configPath, input.entry) && !sameBuildInstalled(packageRoot, packageRootIn(versionDir(configPath, version)))) {
|
|
126
|
+
const target = packageRootIn(versionDir(configPath, version));
|
|
127
|
+
mkdirSync(dirname(target), { recursive: true, mode: RUNNER_DIR_MODE });
|
|
128
|
+
rmSync(target, { recursive: true, force: true });
|
|
129
|
+
cpSync(packageRoot, target, { recursive: true });
|
|
130
|
+
carryHoistedDevcontainerCli(packageRoot, target);
|
|
131
|
+
}
|
|
132
|
+
switchCurrent(configPath, version);
|
|
133
|
+
try {
|
|
134
|
+
return writeLauncher({ home: input.home, configPath, nodePath: input.nodePath, replace: input.replace });
|
|
135
|
+
} catch (error) {
|
|
136
|
+
if (error instanceof LauncherWriteError) throw new RunnerInstallError(error.message);
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
72
140
|
function sameBuildInstalled(source, target) {
|
|
73
141
|
try {
|
|
74
142
|
const wanted = readFileSync(join(source, "dist", "build-info.json"), "utf8");
|
|
@@ -95,4 +163,4 @@ function restartNote(result) {
|
|
|
95
163
|
return `current moved from ${result.previous} to ${result.version}: a runner its service started restarts on ${result.version} at once when its running builds are container builds that carry on through the restart. Otherwise it takes no new work and waits for them to finish. A runner started by hand keeps running until you restart it`;
|
|
96
164
|
}
|
|
97
165
|
|
|
98
|
-
export { RunnerDowngradeError, RunnerInstallError, launcherSummary, restartNote, runRunnerInstall };
|
|
166
|
+
export { RunnerDowngradeError, RunnerInstallError, accountIdentity, accountNamed, handOver, launcherSummary, realOwnership, restartNote, runRunnerInstall };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { reportFailedStart, fitImageBuildMemory } from './chunk-
|
|
3
|
+
import { reportFailedStart, fitImageBuildMemory } from './chunk-6P4YL4CO.js';
|
|
4
4
|
import { writePendingUpdate } from './chunk-TFPNPS4Q.js';
|
|
5
|
-
import { renderUpdateSteps } from './chunk-
|
|
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-
|
|
5
|
+
import { renderUpdateSteps } from './chunk-XJXBQQR4.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-DJO6GI7B.js';
|
|
7
7
|
import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
8
8
|
import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-FDJPDZSR.js';
|
|
9
9
|
import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
|
|
10
10
|
import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
|
|
11
11
|
import { RUNNER_PROTOCOL } from './chunk-PAK5P2ND.js';
|
|
12
|
-
import { realBlockedProbes, checkBlockedWithSlots } from './chunk-
|
|
12
|
+
import { realBlockedProbes, checkBlockedWithSlots } from './chunk-SMWRIAGH.js';
|
|
13
13
|
import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-UMYYYF7B.js';
|
|
14
14
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
15
|
-
import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, setUpRunnerCgroup, sweepImageBuilders, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel } from './chunk-
|
|
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-ZVGSCE2Q.js';
|
|
16
16
|
import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-RFVIQLNB.js';
|
|
17
17
|
import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-SYVRBBLW.js';
|
|
18
18
|
import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
|
|
@@ -3211,7 +3211,7 @@ async function startRunner(configPath, deps, startup) {
|
|
|
3211
3211
|
check: update.check ? () => update.check(configPath) : async () => {
|
|
3212
3212
|
const held = heldClaudeCredential();
|
|
3213
3213
|
const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
|
|
3214
|
-
return (await import('./check-
|
|
3214
|
+
return (await import('./check-YOSEXQPQ.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
|
|
3215
3215
|
},
|
|
3216
3216
|
now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
|
|
3217
3217
|
log
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { placeholderQueues, placeholderProblem } from './chunk-
|
|
3
|
+
import { placeholderQueues, placeholderProblem } from './chunk-ZVGSCE2Q.js';
|
|
4
4
|
import { checkFit } from './chunk-INOUUSYI.js';
|
|
5
5
|
import { builtinKind, imageBuildOf, keepsHostBuilder } from './chunk-2D6CKNR7.js';
|
|
6
6
|
import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-KM2HLQE3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { stripTerminalControls } from './chunk-
|
|
3
|
+
import { stripTerminalControls } from './chunk-DJO6GI7B.js';
|
|
4
4
|
import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-SYVRBBLW.js';
|
|
5
5
|
import { readFileSync } from 'fs';
|
|
6
6
|
|
|
@@ -1217,7 +1217,7 @@ async function gatherDoctorChecks() {
|
|
|
1217
1217
|
const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
|
|
1218
1218
|
checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
|
|
1219
1219
|
} else if (hasRunnerBlock(configPath)) {
|
|
1220
|
-
const { runnerHostChecks } = await import('./doctor-
|
|
1220
|
+
const { runnerHostChecks } = await import('./doctor-Z4OA5JJK.js');
|
|
1221
1221
|
const gateway = (() => {
|
|
1222
1222
|
try {
|
|
1223
1223
|
const { url, apiKey, appId } = loadRunnerConfig(configPath);
|
|
@@ -861,15 +861,38 @@ async function probeHelper(socketPath, options = {}) {
|
|
|
861
861
|
return { ok: false, reason: "absent", unreachable: true, detail: message.includes(socketPath) ? message : `the helper at ${socketPath} did not answer: ${message}` };
|
|
862
862
|
}
|
|
863
863
|
}
|
|
864
|
-
|
|
864
|
+
var DEFAULT_BUILD_SLICE = "system.slice";
|
|
865
|
+
var HELPER_CONFIG_DIR = "/etc/outerlayer";
|
|
866
|
+
function sliceCgroupPath(slice) {
|
|
867
|
+
const parts = slice.replace(/\.slice$/, "").split("-");
|
|
868
|
+
return parts.map((_, i) => `${parts.slice(0, i + 1).join("-")}.slice`).join("/");
|
|
869
|
+
}
|
|
870
|
+
function buildSlices(socketPath, configDir = HELPER_CONFIG_DIR) {
|
|
871
|
+
const named = /^\/run\/([^/]+)\/helper\.sock$/.exec(socketPath ?? "");
|
|
872
|
+
if (named === null) return [DEFAULT_BUILD_SLICE];
|
|
873
|
+
const configPath = join(configDir, `${named[1]}.json`);
|
|
874
|
+
let slice;
|
|
865
875
|
try {
|
|
866
|
-
|
|
876
|
+
slice = JSON.parse(readFileSync(configPath, "utf8")).slice;
|
|
867
877
|
} catch {
|
|
868
|
-
return
|
|
878
|
+
return [DEFAULT_BUILD_SLICE];
|
|
879
|
+
}
|
|
880
|
+
return typeof slice === "string" && slice !== "" && slice !== DEFAULT_BUILD_SLICE ? [slice, DEFAULT_BUILD_SLICE] : [DEFAULT_BUILD_SLICE];
|
|
881
|
+
}
|
|
882
|
+
function jailedAlive(unit, cgroupRoot = "/sys/fs/cgroup", slices = [DEFAULT_BUILD_SLICE]) {
|
|
883
|
+
for (const slice of slices) {
|
|
884
|
+
let events;
|
|
885
|
+
try {
|
|
886
|
+
events = readFileSync(join(cgroupRoot, sliceCgroupPath(slice), `${unit}.service`, "cgroup.events"), "utf8");
|
|
887
|
+
} catch {
|
|
888
|
+
continue;
|
|
889
|
+
}
|
|
890
|
+
return /^populated 1$/m.test(events);
|
|
869
891
|
}
|
|
892
|
+
return false;
|
|
870
893
|
}
|
|
871
|
-
function realHelperPort(env = process.env) {
|
|
872
|
-
return { probe: () => probeHelper(env[HELPER_ENV]), alive: (unit) => jailedAlive(unit) };
|
|
894
|
+
function realHelperPort(env = process.env, host = {}) {
|
|
895
|
+
return { probe: () => probeHelper(env[HELPER_ENV]), alive: (unit) => jailedAlive(unit, host.cgroupRoot, buildSlices(env[HELPER_ENV], host.configDir)) };
|
|
873
896
|
}
|
|
874
897
|
|
|
875
898
|
// src/runner/microvm/host.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { gatherDoctorChecks, doctorExitCode, summarizeChecks, renderDoctorText, recordWrapped, recordUnwrapped, recordRemoval, readManifest, recordInstall, recordStatusline } from './chunk-
|
|
3
|
+
import { gatherDoctorChecks, doctorExitCode, summarizeChecks, renderDoctorText, recordWrapped, recordUnwrapped, recordRemoval, readManifest, recordInstall, recordStatusline } from './chunk-YV7BP62T.js';
|
|
4
4
|
import './chunk-AP2K4LPI.js';
|
|
5
5
|
import './chunk-KT4CN6OU.js';
|
|
6
6
|
import './chunk-4P6QGMPN.js';
|
|
@@ -3926,13 +3926,13 @@ what CLIs older than ${FIRST_VERSION_READING_AGENTS_SKILLS} do. \`` + cliInvocat
|
|
|
3926
3926
|
if (changed.length > 0 && !opts.json) process.stdout.write(`Removed the claude function from ${changed.join(", ")}.
|
|
3927
3927
|
`);
|
|
3928
3928
|
}
|
|
3929
|
-
const shell = !opts.remove && opts.shellFunction !== void 0 ? (await import('./init-cmd-
|
|
3929
|
+
const shell = !opts.remove && opts.shellFunction !== void 0 ? (await import('./init-cmd-FN7CSVLZ.js')).applyShellFunctionFlag(opts.shellFunction, { home: homeFromEnv(), shellPath: process.env.SHELL }) : void 0;
|
|
3930
3930
|
if (opts.json) writeJson(shell === void 0 ? outcome.result : { ...outcome.result, shellFunction: { outcome: shell.outcome, reason: shell.reason } });
|
|
3931
3931
|
else process.stdout.write(outcome.text + skillsLine + (shell?.text ?? ""));
|
|
3932
3932
|
return;
|
|
3933
3933
|
}
|
|
3934
3934
|
await installMachineSkillsForSetup();
|
|
3935
|
-
const { runInitCommand } = await import('./init-cmd-
|
|
3935
|
+
const { runInitCommand } = await import('./init-cmd-FN7CSVLZ.js');
|
|
3936
3936
|
const code = await runInitCommand(
|
|
3937
3937
|
{ json: opts.json, factory: opts.factory, shellFunction: opts.shellFunction },
|
|
3938
3938
|
{
|
|
@@ -5104,7 +5104,7 @@ function registerRunnerCommands(program2) {
|
|
|
5104
5104
|
const configOption = "the cloud config file to run against (default: ~/.outerlayer/config.json)";
|
|
5105
5105
|
runnerCmd.command("start").description("Run the loop: claim work, run it, report, clean up, repeat").option("--config <path>", configOption).action(async (opts) => {
|
|
5106
5106
|
const { defaultRunnerConfigPath, RunnerConfigError } = await import('./config-QASNKYM6.js');
|
|
5107
|
-
const { start, RunnerStartError } = await import('./loop-
|
|
5107
|
+
const { start, RunnerStartError } = await import('./loop-5MVKWHNV.js');
|
|
5108
5108
|
const { RunnerAlreadyRunningError } = await import('./pidfile-EAD2OEM7.js');
|
|
5109
5109
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5110
5110
|
try {
|
|
@@ -5123,8 +5123,8 @@ function registerRunnerCommands(program2) {
|
|
|
5123
5123
|
"\nReads OUTERLAYER_URL, OUTERLAYER_APP_ID, OUTERLAYER_API_KEY, OUTERLAYER_RUNNER_NAME and one Claude credential\n(CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY) from the environment. OUTERLAYER_AGENT\nis optional and defaults to claude. On a later start it refuses variables that disagree with the config in the volume.\nThe image sets OUTERLAYER_RUNNER_IMAGE; outside the image, use `runner start`.\n"
|
|
5124
5124
|
).action(async () => {
|
|
5125
5125
|
const { defaultRunnerConfigPath, RunnerConfigError } = await import('./config-QASNKYM6.js');
|
|
5126
|
-
const { containerStart } = await import('./container-start-
|
|
5127
|
-
const { start, RunnerStartError } = await import('./loop-
|
|
5126
|
+
const { containerStart } = await import('./container-start-3GFLLV4Q.js');
|
|
5127
|
+
const { start, RunnerStartError } = await import('./loop-5MVKWHNV.js');
|
|
5128
5128
|
const { RunnerAlreadyRunningError } = await import('./pidfile-EAD2OEM7.js');
|
|
5129
5129
|
try {
|
|
5130
5130
|
const result = await containerStart({
|
|
@@ -5148,14 +5148,14 @@ function registerRunnerCommands(program2) {
|
|
|
5148
5148
|
).action(async (opts) => {
|
|
5149
5149
|
const { defaultRunnerConfigPath } = await import('./config-QASNKYM6.js');
|
|
5150
5150
|
const { runnerDir } = await import('./paths-T2DEBI62.js');
|
|
5151
|
-
const { runUpdateSteps } = await import('./update-steps-
|
|
5151
|
+
const { runUpdateSteps } = await import('./update-steps-ROLDDTPM.js');
|
|
5152
5152
|
const text = await runUpdateSteps({ runnerDirPath: runnerDir(opts.config ?? defaultRunnerConfigPath()) });
|
|
5153
5153
|
process.stdout.write(`${text}
|
|
5154
5154
|
`);
|
|
5155
5155
|
});
|
|
5156
5156
|
runnerCmd.command("check").description("Validate the config, the hooks and the key, and print the effective settings").option("--config <path>", configOption).action(async (opts) => {
|
|
5157
5157
|
const { defaultRunnerConfigPath } = await import('./config-QASNKYM6.js');
|
|
5158
|
-
const { runRunnerCheck } = await import('./check-
|
|
5158
|
+
const { runRunnerCheck } = await import('./check-YOSEXQPQ.js');
|
|
5159
5159
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5160
5160
|
const result = await runRunnerCheck(configPath);
|
|
5161
5161
|
if (!result.ok) {
|
|
@@ -5177,7 +5177,7 @@ function registerRunnerCommands(program2) {
|
|
|
5177
5177
|
});
|
|
5178
5178
|
runnerCmd.command("install").description("Put this CLI in the runner's install layout; --service adds its service").option("--config <path>", configOption).option("--service", "set up the service that keeps the runner running").option("--print", "with --service, print the unit and set up nothing").option("--user <account>", "with --service, the account the service runs as").option("--replace", "replace a unit or launcher file this command did not write").option("--allow-downgrade", "install this CLI even when it is older than the version the runner runs").option("--unit-name <name>", "with --service, the unit's name, to run a second runner beside the first").option("--build-memory-max <size>", "with --service, memory all builds may use together, such as 16g").option("--build-cpus-max <n>", "with --service, CPUs all builds may use together, such as 4").action(async (opts) => {
|
|
5179
5179
|
const { defaultRunnerConfigPath, RunnerConfigError } = await import('./config-QASNKYM6.js');
|
|
5180
|
-
const { runRunnerInstall, RunnerInstallError, launcherSummary, restartNote } = await import('./install-cmd-
|
|
5180
|
+
const { runRunnerInstall, RunnerInstallError, launcherSummary, restartNote } = await import('./install-cmd-5H6M2KJ7.js');
|
|
5181
5181
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5182
5182
|
if (opts.service !== true) {
|
|
5183
5183
|
const names = { print: "print", user: "user", unitName: "unit-name", buildMemoryMax: "build-memory-max", buildCpusMax: "build-cpus-max" };
|
|
@@ -5189,13 +5189,13 @@ function registerRunnerCommands(program2) {
|
|
|
5189
5189
|
}
|
|
5190
5190
|
}
|
|
5191
5191
|
const buildCpusMax = opts.buildCpusMax === void 0 ? void 0 : Number(opts.buildCpusMax);
|
|
5192
|
-
if (buildCpusMax !== void 0 && !(await import('./command-
|
|
5192
|
+
if (buildCpusMax !== void 0 && !(await import('./command-BC2NOUA5.js')).cpusAreValid(buildCpusMax)) {
|
|
5193
5193
|
fail(`--build-cpus-max ${opts.buildCpusMax} is not a number of CPUs from 0.01 to 1024.`);
|
|
5194
5194
|
return;
|
|
5195
5195
|
}
|
|
5196
5196
|
try {
|
|
5197
5197
|
if (opts.service === true) {
|
|
5198
|
-
const { installServiceCommand } = await import('./command-
|
|
5198
|
+
const { installServiceCommand } = await import('./command-BC2NOUA5.js');
|
|
5199
5199
|
const result2 = await installServiceCommand({
|
|
5200
5200
|
configPath,
|
|
5201
5201
|
print: opts.print,
|
|
@@ -5253,7 +5253,7 @@ To keep it running, run ${C.yellow}${cliInvocation()} runner install --service${
|
|
|
5253
5253
|
return;
|
|
5254
5254
|
}
|
|
5255
5255
|
const { defaultRunnerConfigPath } = await import('./config-QASNKYM6.js');
|
|
5256
|
-
const { uninstallServiceCommand } = await import('./command-
|
|
5256
|
+
const { uninstallServiceCommand } = await import('./command-BC2NOUA5.js');
|
|
5257
5257
|
const result = await uninstallServiceCommand({ configPath: opts.config ?? defaultRunnerConfigPath(), unitName: opts.unitName, home: homeFromEnv() });
|
|
5258
5258
|
if (result.ok) for (const line of result.lines) process.stdout.write(`${C.green}\u2713${C.reset} ${line}
|
|
5259
5259
|
`);
|
|
@@ -5281,10 +5281,10 @@ already in claude.env is used.
|
|
|
5281
5281
|
`
|
|
5282
5282
|
).action(async (opts) => {
|
|
5283
5283
|
const { defaultRunnerConfigPath, RunnerConfigError } = await import('./config-QASNKYM6.js');
|
|
5284
|
-
const { prepareRunnerInit, runRunnerInit, RunnerInitError, writeRunnerInit } = await import('./init-
|
|
5285
|
-
const { obtainRunnerKey, runnerKeyLogin } = await import('./runner-key-
|
|
5286
|
-
const { detectMachine } = await import('./machine-
|
|
5287
|
-
const { chooseVm, runVmInit, VmInitError } = await import('./init-
|
|
5284
|
+
const { prepareRunnerInit, runRunnerInit, RunnerInitError, writeRunnerInit } = await import('./init-3KP2CDZJ.js');
|
|
5285
|
+
const { obtainRunnerKey, runnerKeyLogin } = await import('./runner-key-WY6KFIRA.js');
|
|
5286
|
+
const { detectMachine } = await import('./machine-APH6CXPC.js');
|
|
5287
|
+
const { chooseVm, runVmInit, VmInitError } = await import('./init-43LJRRQO.js');
|
|
5288
5288
|
const { AGENT_COMMANDS, credentialFromStdin, isAgentName, restartForCredential, RunnerEnvError } = await import('./runner-env-BJPUHAKZ.js');
|
|
5289
5289
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5290
5290
|
if (opts.agent !== void 0 && !isAgentName(opts.agent)) {
|
|
@@ -5403,7 +5403,7 @@ ${C.yellow}${result.note}${C.reset}
|
|
|
5403
5403
|
To isolate builds in containers instead, run ${C.yellow}${cliInvocation()} runner init --vm${C.reset}.
|
|
5404
5404
|
`);
|
|
5405
5405
|
}
|
|
5406
|
-
const { runRunnerInstall, RunnerInstallError, RunnerDowngradeError, launcherSummary } = await import('./install-cmd-
|
|
5406
|
+
const { runRunnerInstall, RunnerInstallError, RunnerDowngradeError, launcherSummary } = await import('./install-cmd-5H6M2KJ7.js');
|
|
5407
5407
|
let installedLayout = false;
|
|
5408
5408
|
let noService = "it starts the runner from the install layout, which needs a CLI installed with npm";
|
|
5409
5409
|
try {
|
|
@@ -5435,7 +5435,7 @@ ${C.yellow}The runner will not update itself: ${installErr.message}${C.reset}
|
|
|
5435
5435
|
let serviceUp = false;
|
|
5436
5436
|
let restart;
|
|
5437
5437
|
if (installedLayout) {
|
|
5438
|
-
const { installServiceCommand } = await import('./command-
|
|
5438
|
+
const { installServiceCommand } = await import('./command-BC2NOUA5.js');
|
|
5439
5439
|
const service = await installServiceCommand({
|
|
5440
5440
|
configPath,
|
|
5441
5441
|
entryPath: process.argv[1] ?? "",
|
|
@@ -5563,7 +5563,7 @@ Next:
|
|
|
5563
5563
|
});
|
|
5564
5564
|
runnerCmd.command("stop").description("Take no more work; finish running jobs, then exit").option("--config <path>", "the cloud config file naming the runner to stop").option("--now", "end running jobs immediately, with outcome stopped").action(async (opts) => {
|
|
5565
5565
|
const { defaultRunnerConfigPath } = await import('./config-QASNKYM6.js');
|
|
5566
|
-
const { requestStop } = await import('./loop-
|
|
5566
|
+
const { requestStop } = await import('./loop-5MVKWHNV.js');
|
|
5567
5567
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5568
5568
|
const { runnerImageVersion } = await import('./image-tag-SEMBVB5D.js');
|
|
5569
5569
|
await requestStop(configPath, Boolean(opts.now), void 0, { image: runnerImageVersion() !== void 0 });
|
|
@@ -5571,8 +5571,8 @@ Next:
|
|
|
5571
5571
|
runnerCmd.command("status").description("List running jobs; with --recent, finished ones too").option("--config <path>", "the cloud config file naming the runner to inspect").option("--recent", "also list finished jobs, newest first, capped at 20").option("--json", "machine-readable JSON output").action(async (opts) => {
|
|
5572
5572
|
const { defaultRunnerConfigPath, loadRunnerConfig } = await import('./config-QASNKYM6.js');
|
|
5573
5573
|
const { jobsDir, runnerDir } = await import('./paths-T2DEBI62.js');
|
|
5574
|
-
const { listJobFiles, runnerProcessState } = await import('./loop-
|
|
5575
|
-
const { renderStatus } = await import('./status-
|
|
5574
|
+
const { listJobFiles, runnerProcessState } = await import('./loop-5MVKWHNV.js');
|
|
5575
|
+
const { renderStatus } = await import('./status-U3Y6HJJI.js');
|
|
5576
5576
|
const { readHousekeepingRecord } = await import('./record-IMXQNHPB.js');
|
|
5577
5577
|
const path2 = await import('path');
|
|
5578
5578
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
@@ -5631,7 +5631,7 @@ Next:
|
|
|
5631
5631
|
});
|
|
5632
5632
|
runnerCmd.command("logs").argument("<item>", "the work item's number in the factory").description("Print the newest attempt's log for one item").option("--config <path>", "the cloud config file naming the runner to inspect").option("-f, --follow", "keep printing as the log grows").action(async (itemArg, opts) => {
|
|
5633
5633
|
const { defaultRunnerConfigPath } = await import('./config-QASNKYM6.js');
|
|
5634
|
-
const { listJobFiles } = await import('./loop-
|
|
5634
|
+
const { listJobFiles } = await import('./loop-5MVKWHNV.js');
|
|
5635
5635
|
const { newestAttempt, logPathFor, tail, RunnerLogsError } = await import('./logs-6CMB3DO6.js');
|
|
5636
5636
|
const configPath = opts.config ?? defaultRunnerConfigPath();
|
|
5637
5637
|
const item = parseTrackerNumber(itemArg);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { runRunnerInstall, launcherSummary, restartNote } from './chunk-
|
|
3
|
+
import { realOwnership, accountNamed, handOver, runRunnerInstall, launcherSummary, restartNote, accountIdentity } from './chunk-GC5PVMIJ.js';
|
|
4
4
|
import './chunk-OS7DJOQJ.js';
|
|
5
5
|
import { currentLink, execStartCommand } from './chunk-UMYYYF7B.js';
|
|
6
|
-
import { detectMachine, helperSocketPath, ensureFirecrackerAndJailer } from './chunk-
|
|
6
|
+
import { detectMachine, helperSocketPath, ensureFirecrackerAndJailer } from './chunk-ZVGSCE2Q.js';
|
|
7
7
|
import './chunk-2PGI6RDE.js';
|
|
8
8
|
import './chunk-UO4FQAOX.js';
|
|
9
9
|
import './chunk-OGFGZQA3.js';
|
|
@@ -51,12 +51,12 @@ import './chunk-YQR6E6OV.js';
|
|
|
51
51
|
import './chunk-FGXT5OXS.js';
|
|
52
52
|
import './chunk-EOTMDIYC.js';
|
|
53
53
|
import './chunk-VNVZDWO3.js';
|
|
54
|
-
import { runnerDir } from './chunk-PXGU3GKY.js';
|
|
55
|
-
import './chunk-G4W4B33M.js';
|
|
54
|
+
import { runnerDir, vmAssetsDir } from './chunk-PXGU3GKY.js';
|
|
55
|
+
import { CLAUDE_ENV_FILE } from './chunk-G4W4B33M.js';
|
|
56
56
|
import './chunk-MESOOLF4.js';
|
|
57
57
|
import './chunk-Z5GEFMRW.js';
|
|
58
58
|
import { userInfo, totalmem, tmpdir } from 'os';
|
|
59
|
-
import {
|
|
59
|
+
import { dirname, join } from 'path';
|
|
60
60
|
import { createHash } from 'crypto';
|
|
61
61
|
import { rmSync, existsSync, readdirSync, mkdtempSync, writeFileSync, readFileSync, statSync, lstatSync } from 'fs';
|
|
62
62
|
import { spawnSync } from 'child_process';
|
|
@@ -485,11 +485,6 @@ function readHelperRanges(dir = HELPER_CONFIG_DIR) {
|
|
|
485
485
|
}
|
|
486
486
|
return ranges;
|
|
487
487
|
}
|
|
488
|
-
function idOf(flag, account) {
|
|
489
|
-
const result = spawnSync("id", [flag, account], { encoding: "utf8" });
|
|
490
|
-
const id = Number(result.stdout);
|
|
491
|
-
return result.status === 0 && Number.isInteger(id) ? id : void 0;
|
|
492
|
-
}
|
|
493
488
|
function realHelperDeps() {
|
|
494
489
|
const arch = firecrackerArch(process.arch);
|
|
495
490
|
const pinnedArch = MICROVM_ARCHES.includes(arch) ? arch : void 0;
|
|
@@ -518,11 +513,7 @@ function realHelperDeps() {
|
|
|
518
513
|
return void 0;
|
|
519
514
|
}
|
|
520
515
|
},
|
|
521
|
-
identity:
|
|
522
|
-
const uid = account === userInfo().username ? userInfo().uid : idOf("-u", account);
|
|
523
|
-
const gid = account === userInfo().username ? userInfo().gid : idOf("-g", account);
|
|
524
|
-
return uid === void 0 || gid === void 0 || uid < 0 || gid < 0 ? void 0 : { uid, gid };
|
|
525
|
-
},
|
|
516
|
+
identity: accountIdentity,
|
|
526
517
|
jailBase: findJailBase,
|
|
527
518
|
uidRangeTaker: idRangeTaker,
|
|
528
519
|
helperRanges: () => readHelperRanges(),
|
|
@@ -587,6 +578,28 @@ function sliceOf(input, usesVm, helperVersion) {
|
|
|
587
578
|
return { limits: { memoryMaxBytes, cpus: input.buildCpusMax } };
|
|
588
579
|
}
|
|
589
580
|
async function installServiceCommand(input, deps = {}) {
|
|
581
|
+
if (input.print === true) return installServiceSteps(input, deps);
|
|
582
|
+
const ownership = deps.ownership ?? realOwnership();
|
|
583
|
+
const account = accountNamed(serviceAccount(input), ownership);
|
|
584
|
+
let result;
|
|
585
|
+
try {
|
|
586
|
+
result = await installServiceSteps(input, deps);
|
|
587
|
+
} finally {
|
|
588
|
+
const configDir = dirname(input.configPath);
|
|
589
|
+
const runner = runnerDir(input.configPath);
|
|
590
|
+
const problem = handOver(
|
|
591
|
+
account,
|
|
592
|
+
[{ path: join(configDir, CLAUDE_ENV_FILE) }, { path: join(configDir, "runner.env") }, { path: runner }, { path: dirname(vmAssetsDir(runner)) }, { path: vmAssetsDir(runner), tree: true }],
|
|
593
|
+
ownership
|
|
594
|
+
);
|
|
595
|
+
if (problem !== void 0 && result !== void 0) result = { ...result, ok: false, state: "refused", lines: [...result.lines, problem] };
|
|
596
|
+
}
|
|
597
|
+
return result;
|
|
598
|
+
}
|
|
599
|
+
function serviceAccount(input) {
|
|
600
|
+
return input.user ?? userInfo().username;
|
|
601
|
+
}
|
|
602
|
+
async function installServiceSteps(input, deps) {
|
|
590
603
|
const nameProblem = input.unitName === void 0 ? void 0 : unitNameProblem(input.unitName);
|
|
591
604
|
if (nameProblem !== void 0) return { ok: false, state: "refused", lines: [nameProblem] };
|
|
592
605
|
const vm = runnerVmOf(input.configPath);
|
|
@@ -607,13 +620,15 @@ async function installServiceCommand(input, deps = {}) {
|
|
|
607
620
|
PATH: process.env.PATH,
|
|
608
621
|
replace: input.replace,
|
|
609
622
|
allowDowngrade: input.allowDowngrade,
|
|
610
|
-
command: "runner install --service"
|
|
623
|
+
command: "runner install --service",
|
|
624
|
+
account: serviceAccount(input),
|
|
625
|
+
ownership: deps.ownership
|
|
611
626
|
});
|
|
612
627
|
launcherLines = [launcherSummary(installed.launcher)].filter((line) => line !== void 0);
|
|
613
628
|
launcherNotes = installed.launcher.notes;
|
|
614
629
|
restartLine = restartNote(installed);
|
|
615
630
|
}
|
|
616
|
-
const account = input
|
|
631
|
+
const account = serviceAccount(input);
|
|
617
632
|
const serviceDeps = (deps.service ?? realServiceDeps)();
|
|
618
633
|
if (input.print !== true && account !== userInfo().username && serviceDeps.accountCan !== void 0) {
|
|
619
634
|
const entry = join(currentLink(input.configPath), "node_modules", "@outerlayer", "cli", "dist", "index.js");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { reportFailedStart, BUILD_MEMORY_VARIABLE } from './chunk-
|
|
4
|
-
import { readOwnContainer } from './chunk-
|
|
5
|
-
import './chunk-
|
|
3
|
+
import { reportFailedStart, BUILD_MEMORY_VARIABLE } from './chunk-6P4YL4CO.js';
|
|
4
|
+
import { readOwnContainer } from './chunk-XJXBQQR4.js';
|
|
5
|
+
import './chunk-DJO6GI7B.js';
|
|
6
6
|
import './chunk-ZVB57WI6.js';
|
|
7
7
|
import './chunk-63IVRRIO.js';
|
|
8
8
|
import './chunk-I3LTIAOR.js';
|
|
@@ -12,7 +12,7 @@ import './chunk-EGVHFHY4.js';
|
|
|
12
12
|
import './chunk-ESVW4MJY.js';
|
|
13
13
|
import './chunk-SI6WDF3U.js';
|
|
14
14
|
import './chunk-TBT347UY.js';
|
|
15
|
-
import { detectMachine, supportsContainerBuilds, MIN_ENGINE_MAJOR, describeMachineDocker, RunnerInitError, prepareRunnerInit, writeRunnerInit } from './chunk-
|
|
15
|
+
import { detectMachine, supportsContainerBuilds, MIN_ENGINE_MAJOR, describeMachineDocker, RunnerInitError, prepareRunnerInit, writeRunnerInit } from './chunk-ZVGSCE2Q.js';
|
|
16
16
|
import './chunk-2PGI6RDE.js';
|
|
17
17
|
import './chunk-UO4FQAOX.js';
|
|
18
18
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { launcherCheck } from './chunk-OS7DJOQJ.js';
|
|
4
|
-
import { managedProblems } from './chunk-
|
|
4
|
+
import { managedProblems } from './chunk-SMWRIAGH.js';
|
|
5
5
|
import './chunk-UMYYYF7B.js';
|
|
6
6
|
import { RepoFilter } from './chunk-TBT347UY.js';
|
|
7
|
-
import { needsClaudeCredential, claudeCredentialCheck, detectMachine, supportsContainerBuilds, describeMachineDocker, MIN_ENGINE_MAJOR, reachDockerStep, supportsMicroVmBuilds, microVmArchSupported, microVmAssetsPinned, helperFirecrackerNote, probeHelper, helperSocketPath, missingPermissionOf, missingPermissionFix } from './chunk-
|
|
7
|
+
import { needsClaudeCredential, claudeCredentialCheck, detectMachine, supportsContainerBuilds, describeMachineDocker, MIN_ENGINE_MAJOR, reachDockerStep, supportsMicroVmBuilds, microVmArchSupported, microVmAssetsPinned, helperFirecrackerNote, probeHelper, helperSocketPath, missingPermissionOf, missingPermissionFix } from './chunk-ZVGSCE2Q.js';
|
|
8
8
|
import './chunk-2PGI6RDE.js';
|
|
9
9
|
import './chunk-UO4FQAOX.js';
|
|
10
10
|
import './chunk-OGFGZQA3.js';
|
package/dist/index.js
CHANGED
|
@@ -26,5 +26,5 @@ if (argv[0] === "claude") {
|
|
|
26
26
|
process.exit(await runClaudeLauncher(argv.slice(1)));
|
|
27
27
|
}
|
|
28
28
|
(await import('./hook-fast-GPUL7T77.js')).recordLinkExitFailure(argv);
|
|
29
|
-
var { runCli } = await import('./cli-
|
|
29
|
+
var { runCli } = await import('./cli-NKT5FAP3.js');
|
|
30
30
|
await runCli(process.argv);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { PLACEHOLDER_MARKER, RunnerInitError, isPlaceholderCommand, prepareRunnerInit, readConfigObject, runRunnerInit, writeRunnerInit } from './chunk-
|
|
3
|
+
export { PLACEHOLDER_MARKER, RunnerInitError, isPlaceholderCommand, prepareRunnerInit, readConfigObject, runRunnerInit, writeRunnerInit } from './chunk-ZVGSCE2Q.js';
|
|
4
4
|
import './chunk-2PGI6RDE.js';
|
|
5
5
|
import './chunk-UO4FQAOX.js';
|
|
6
6
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { npmSupportsProvenance } from './chunk-E7R2GIAW.js';
|
|
4
|
-
import { RunnerInitError, readConfigObject } from './chunk-
|
|
4
|
+
import { RunnerInitError, readConfigObject } from './chunk-ZVGSCE2Q.js';
|
|
5
5
|
import './chunk-2PGI6RDE.js';
|
|
6
6
|
import './chunk-UO4FQAOX.js';
|
|
7
7
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-
|
|
3
|
+
import { summarizeChecks, summaryText, renderDoctorText } from './chunk-YV7BP62T.js';
|
|
4
4
|
import './chunk-AP2K4LPI.js';
|
|
5
5
|
import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-CJJDJ7AT.js';
|
|
6
6
|
import './chunk-KT4CN6OU.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { RunnerDowngradeError, RunnerInstallError, launcherSummary, restartNote, runRunnerInstall } from './chunk-
|
|
3
|
+
export { RunnerDowngradeError, RunnerInstallError, launcherSummary, restartNote, runRunnerInstall } from './chunk-GC5PVMIJ.js';
|
|
4
4
|
import './chunk-OS7DJOQJ.js';
|
|
5
5
|
import './chunk-UMYYYF7B.js';
|
|
6
6
|
import './chunk-TQMI335S.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { RunnerStartError, leaseTimeLeftFor, listJobFiles, logUnusableHelper, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
export { RunnerStartError, leaseTimeLeftFor, listJobFiles, logUnusableHelper, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick } from './chunk-RLPIRL33.js';
|
|
4
|
+
import './chunk-6P4YL4CO.js';
|
|
5
5
|
import './chunk-TFPNPS4Q.js';
|
|
6
|
-
import './chunk-
|
|
7
|
-
import './chunk-
|
|
6
|
+
import './chunk-XJXBQQR4.js';
|
|
7
|
+
import './chunk-DJO6GI7B.js';
|
|
8
8
|
import './chunk-ZVB57WI6.js';
|
|
9
9
|
import './chunk-FDJPDZSR.js';
|
|
10
10
|
import './chunk-3JVYMD4G.js';
|
|
@@ -17,10 +17,10 @@ import './chunk-QANM5COC.js';
|
|
|
17
17
|
import './chunk-EGVHFHY4.js';
|
|
18
18
|
import './chunk-ESVW4MJY.js';
|
|
19
19
|
import './chunk-SI6WDF3U.js';
|
|
20
|
-
import './chunk-
|
|
20
|
+
import './chunk-SMWRIAGH.js';
|
|
21
21
|
import './chunk-UMYYYF7B.js';
|
|
22
22
|
import './chunk-TBT347UY.js';
|
|
23
|
-
import './chunk-
|
|
23
|
+
import './chunk-ZVGSCE2Q.js';
|
|
24
24
|
import './chunk-2PGI6RDE.js';
|
|
25
25
|
import './chunk-UO4FQAOX.js';
|
|
26
26
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { describeMachineDocker, detectMachine, microVmArchSupported, microVmAssetsPinned, reachDockerStep, supportsContainerBuilds, supportsMicroVmBuilds } from './chunk-
|
|
3
|
+
export { describeMachineDocker, detectMachine, microVmArchSupported, microVmAssetsPinned, reachDockerStep, supportsContainerBuilds, supportsMicroVmBuilds } from './chunk-ZVGSCE2Q.js';
|
|
4
4
|
import './chunk-2PGI6RDE.js';
|
|
5
5
|
import './chunk-UO4FQAOX.js';
|
|
6
6
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { readConfigObject, RunnerInitError } from './chunk-
|
|
3
|
+
import { readConfigObject, RunnerInitError } from './chunk-ZVGSCE2Q.js';
|
|
4
4
|
import './chunk-2PGI6RDE.js';
|
|
5
5
|
import './chunk-UO4FQAOX.js';
|
|
6
6
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
import { isReadable, ALREADY_RELEASED, RENEW_INTERVAL_SECONDS } from './chunk-
|
|
3
|
+
import { isReadable, ALREADY_RELEASED, RENEW_INTERVAL_SECONDS } from './chunk-DJO6GI7B.js';
|
|
4
4
|
import { jobStateFormatOf } from './chunk-ZVB57WI6.js';
|
|
5
5
|
import './chunk-63IVRRIO.js';
|
|
6
6
|
import './chunk-I3LTIAOR.js';
|
|
@@ -10,7 +10,7 @@ import './chunk-EGVHFHY4.js';
|
|
|
10
10
|
import './chunk-ESVW4MJY.js';
|
|
11
11
|
import './chunk-SI6WDF3U.js';
|
|
12
12
|
import './chunk-TBT347UY.js';
|
|
13
|
-
import { LEASE_SECONDS } from './chunk-
|
|
13
|
+
import { LEASE_SECONDS } from './chunk-ZVGSCE2Q.js';
|
|
14
14
|
import './chunk-2PGI6RDE.js';
|
|
15
15
|
import './chunk-UO4FQAOX.js';
|
|
16
16
|
import './chunk-OGFGZQA3.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
|
-
export { readOwnContainer, renderUpdateSteps, runUpdateSteps } from './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
export { readOwnContainer, renderUpdateSteps, runUpdateSteps } from './chunk-XJXBQQR4.js';
|
|
4
|
+
import './chunk-DJO6GI7B.js';
|
|
5
5
|
import './chunk-ZVB57WI6.js';
|
|
6
6
|
import './chunk-63IVRRIO.js';
|
|
7
7
|
import './chunk-I3LTIAOR.js';
|
|
@@ -11,7 +11,7 @@ import './chunk-EGVHFHY4.js';
|
|
|
11
11
|
import './chunk-ESVW4MJY.js';
|
|
12
12
|
import './chunk-SI6WDF3U.js';
|
|
13
13
|
import './chunk-TBT347UY.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-ZVGSCE2Q.js';
|
|
15
15
|
import './chunk-2PGI6RDE.js';
|
|
16
16
|
import './chunk-UO4FQAOX.js';
|
|
17
17
|
import './chunk-OGFGZQA3.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@outerlayer/cli",
|
|
3
|
-
"version": "0.34.0-next.
|
|
3
|
+
"version": "0.34.0-next.20261025224117",
|
|
4
4
|
"description": "OuterLayer CLI — commands: init, claude, connect, doctor, login, logout, sync, daemon (alias: watch), emit, findings, work, spec, runner, hooks, mcp, context. Capture and sync coding-agent sessions, and record proof of factory work.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Magu Studios, Inc.",
|