@outerlayer/cli 0.40.0-next.20261115012015 → 0.40.0-next.20261115013314

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.
@@ -1 +1 @@
1
- {"id":"2026-11-15T01:28:27.112Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
1
+ {"id":"2026-11-15T02:02:17.293Z","root":"/home/runner/work/outerlayer/outerlayer","pkg":"outerlayer"}
@@ -114,6 +114,11 @@ function uninstallSandboxAgent(request, host) {
114
114
  }
115
115
  return outcome(true, "removed", [`removed the launch agent ${label}`]);
116
116
  }
117
+ function launchAgentServiceState(input, host) {
118
+ const agent = sandboxAgentStatus(input.configPath, input.home, host);
119
+ if (agent !== void 0) return { kind: "launch-agent", unit: agent.label, running: agent.loaded, delegated: void 0 };
120
+ return input.buildsInSandboxes ? { kind: "launch-agent", unit: void 0, running: false, delegated: void 0 } : void 0;
121
+ }
117
122
  function sandboxAgentStatus(configPath, home, host) {
118
123
  const directory = agentsDir(home);
119
124
  for (const name of host.list(directory)) {
@@ -126,4 +131,4 @@ function sandboxAgentStatus(configPath, home, host) {
126
131
  return void 0;
127
132
  }
128
133
 
129
- export { installSandboxAgent, sandboxAgentStatus, uninstallSandboxAgent };
134
+ export { installSandboxAgent, launchAgentServiceState, sandboxAgentStatus, uninstallSandboxAgent };
@@ -1081,7 +1081,7 @@ async function gatherDoctorChecks(options = {}) {
1081
1081
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1082
1082
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1083
1083
  } else if (hasRunnerBlock(configPath)) {
1084
- const { runnerHostChecks } = await import('./doctor-6VSCTPWX.js');
1084
+ const { runnerHostChecks } = await import('./doctor-U3DJQGCO.js');
1085
1085
  const gateway = (() => {
1086
1086
  try {
1087
1087
  const loaded = loadRunnerConfig(configPath);
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-Y2US5RDK.js';
4
- import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-WR2TR6BC.js';
3
+ import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-S4XEMYAP.js';
4
+ import { currentVersion, entryIn, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-WR2TR6BC.js';
5
5
  import { compareVersions } from './chunk-TQMI335S.js';
6
+ import { defaultRunnerConfigPath } from './chunk-MP6INWPC.js';
6
7
  import { runnerDir, RUNNER_DIR_MODE } from './chunk-2OSEUHWY.js';
7
8
  import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
8
- import { dirname, sep, join } from 'path';
9
+ import { dirname, sep, join, resolve } from 'path';
9
10
  import { spawnSync } from 'child_process';
10
11
  import { userInfo } from 'os';
11
12
 
@@ -92,8 +93,9 @@ function runRunnerInstall(args) {
92
93
  const installed = currentVersion(configPath);
93
94
  if (args.allowDowngrade !== true && installed !== void 0 && (compareVersions(version, installed) ?? 0) < 0) {
94
95
  const command = args.command ?? "runner install";
96
+ const newer = followsLauncher(configPath, args.home) ? `${launcherPath(args.home)} ${command}` : `${nodePath} ${entryIn(currentLink(configPath))} ${command} --config ${configPath}`;
95
97
  throw new RunnerDowngradeError(
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\``
98
+ `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 \`${newer}\` instead, which runs ${installed}. To install ${version} anyway, run \`outerlayer ${command} --allow-downgrade\``
97
99
  );
98
100
  }
99
101
  const ownership = args.ownership ?? realOwnership();
@@ -105,7 +107,7 @@ function runRunnerInstall(args) {
105
107
  } finally {
106
108
  const launcher = launcherPath(args.home);
107
109
  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);
110
+ (written?.state === "skipped" ? void 0 : handOver(homeAccount, [{ path: join(args.home, ".local") }, { path: dirname(launcher) }, ...written === void 0 || written.state === "foreign" ? [] : [{ path: launcher }]], ownership));
109
111
  if (problem !== void 0 && written !== void 0) throw new RunnerInstallError(problem);
110
112
  }
111
113
  return {
@@ -130,6 +132,7 @@ function placeInLayout(input) {
130
132
  carryHoistedDevcontainerCli(packageRoot, target);
131
133
  }
132
134
  switchCurrent(configPath, version);
135
+ if (!followsLauncher(configPath, input.home)) return { path: launcherPath(input.home), state: "skipped" };
133
136
  try {
134
137
  return writeLauncher({ home: input.home, configPath, nodePath: input.nodePath, replace: input.replace });
135
138
  } catch (error) {
@@ -137,6 +140,9 @@ function placeInLayout(input) {
137
140
  throw error;
138
141
  }
139
142
  }
143
+ function followsLauncher(configPath, home) {
144
+ return resolve(configPath) === resolve(defaultRunnerConfigPath(home));
145
+ }
140
146
  function sameBuildInstalled(source, target) {
141
147
  try {
142
148
  const wanted = readFileSync(join(source, "dist", "build-info.json"), "utf8");
@@ -156,6 +162,7 @@ function carryHoistedDevcontainerCli(packageRoot, target) {
156
162
  }
157
163
  function launcherSummary(launcher) {
158
164
  if (launcher.state === "foreign") return void 0;
165
+ if (launcher.state === "skipped") return `left the outerlayer command as it is: only the runner of the default config writes ${launcher.path}`;
159
166
  return `${launcher.state === "unchanged" ? "outerlayer command already at" : "wrote the outerlayer command at"} ${launcher.path}, which runs the CLI that ${launcher.follows} names`;
160
167
  }
161
168
  function restartNote(result) {
@@ -91,6 +91,7 @@ function onPath(PATH, dir) {
91
91
  }
92
92
  function pathNotes(input) {
93
93
  const notes = [];
94
+ if (input.state === "skipped") return notes;
94
95
  if (input.state === "foreign") {
95
96
  notes.push(`${input.launcher} exists and the runner did not write it, so it was left alone. Run \`outerlayer runner install --replace\` to replace it`);
96
97
  return notes;
@@ -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-5MCLOGP5.js';
3
+ import { gatherDoctorChecks, doctorExitCode, summarizeChecks, renderDoctorText, recordWrapped, recordUnwrapped, recordRemoval, readManifest, recordInstall, recordStatusline } from './chunk-G6WWNIAY.js';
4
4
  import './chunk-ADXJXXGU.js';
5
5
  import { verifiedTrackerNames, TRACKERS } from './chunk-UDFHJ4KG.js';
6
6
  import './chunk-7RDHN455.js';
@@ -3954,13 +3954,13 @@ what CLIs older than ${FIRST_VERSION_READING_AGENTS_SKILLS} do. \`` + cliInvocat
3954
3954
  if (changed.length > 0 && !opts.json) process.stdout.write(`Removed the claude function from ${changed.join(", ")}.
3955
3955
  `);
3956
3956
  }
3957
- const shell = !opts.remove && opts.shellFunction !== void 0 ? (await import('./init-cmd-UEILLR5H.js')).applyShellFunctionFlag(opts.shellFunction, { home: homeFromEnv(), shellPath: process.env.SHELL }) : void 0;
3957
+ const shell = !opts.remove && opts.shellFunction !== void 0 ? (await import('./init-cmd-3PNKJZRH.js')).applyShellFunctionFlag(opts.shellFunction, { home: homeFromEnv(), shellPath: process.env.SHELL }) : void 0;
3958
3958
  if (opts.json) writeJson(shell === void 0 ? outcome.result : { ...outcome.result, shellFunction: { outcome: shell.outcome, reason: shell.reason } });
3959
3959
  else process.stdout.write(outcome.text + skillsLine + (shell?.text ?? ""));
3960
3960
  return;
3961
3961
  }
3962
3962
  await installMachineSkillsForSetup();
3963
- const { runInitCommand } = await import('./init-cmd-UEILLR5H.js');
3963
+ const { runInitCommand } = await import('./init-cmd-3PNKJZRH.js');
3964
3964
  const code = await runInitCommand(
3965
3965
  { json: opts.json, factory: opts.factory, shellFunction: opts.shellFunction },
3966
3966
  {
@@ -5551,7 +5551,7 @@ The image sets OUTERLAYER_RUNNER_IMAGE; outside the image, use \`runner start\`.
5551
5551
  });
5552
5552
  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) => {
5553
5553
  const { defaultRunnerConfigPath, RunnerConfigError } = await import('./config-PFQRCT5B.js');
5554
- const { runRunnerInstall, RunnerInstallError, launcherSummary, restartNote } = await import('./install-cmd-WQ2KFKHI.js');
5554
+ const { runRunnerInstall, RunnerInstallError, launcherSummary, restartNote } = await import('./install-cmd-5WRSO54T.js');
5555
5555
  const configPath = opts.config ?? defaultRunnerConfigPath();
5556
5556
  if (opts.service !== true) {
5557
5557
  const names = { print: "print", user: "user", unitName: "unit-name", buildMemoryMax: "build-memory-max", buildCpusMax: "build-cpus-max" };
@@ -5563,13 +5563,13 @@ The image sets OUTERLAYER_RUNNER_IMAGE; outside the image, use \`runner start\`.
5563
5563
  }
5564
5564
  }
5565
5565
  const buildCpusMax = opts.buildCpusMax === void 0 ? void 0 : Number(opts.buildCpusMax);
5566
- if (buildCpusMax !== void 0 && !(await import('./command-IJ7NRXFE.js')).cpusAreValid(buildCpusMax)) {
5566
+ if (buildCpusMax !== void 0 && !(await import('./command-YD3EHTZQ.js')).cpusAreValid(buildCpusMax)) {
5567
5567
  fail(`--build-cpus-max ${opts.buildCpusMax} is not a number of CPUs from 0.01 to 1024.`);
5568
5568
  return;
5569
5569
  }
5570
5570
  try {
5571
5571
  if (opts.service === true) {
5572
- const { installServiceCommand, serviceSuccessText } = await import('./command-IJ7NRXFE.js');
5572
+ const { installServiceCommand, serviceSuccessText } = await import('./command-YD3EHTZQ.js');
5573
5573
  const result2 = await installServiceCommand({
5574
5574
  configPath,
5575
5575
  print: opts.print,
@@ -5624,7 +5624,7 @@ To keep it running, run ${C.yellow}${cliInvocation()} runner install --service${
5624
5624
  return;
5625
5625
  }
5626
5626
  const { defaultRunnerConfigPath } = await import('./config-PFQRCT5B.js');
5627
- const { uninstallServiceCommand } = await import('./command-IJ7NRXFE.js');
5627
+ const { uninstallServiceCommand } = await import('./command-YD3EHTZQ.js');
5628
5628
  const result = await uninstallServiceCommand({ configPath: opts.config ?? defaultRunnerConfigPath(), unitName: opts.unitName, home: homeFromEnv() });
5629
5629
  if (result.ok) for (const line of result.lines) process.stdout.write(`${C.green}\u2713${C.reset} ${line}
5630
5630
  `);
@@ -5821,7 +5821,7 @@ hooks: ${result2.hooks}
5821
5821
  else process.stdout.write(`${C.green}\u2713${C.reset} the gateway provides sandboxes to this runner
5822
5822
  `);
5823
5823
  }
5824
- const { runRunnerInstall, RunnerInstallError, RunnerDowngradeError, launcherSummary } = await import('./install-cmd-WQ2KFKHI.js');
5824
+ const { runRunnerInstall, RunnerInstallError, RunnerDowngradeError, launcherSummary } = await import('./install-cmd-5WRSO54T.js');
5825
5825
  let installedLayout = false;
5826
5826
  let noService = "it starts the runner from the install layout, which needs a CLI installed with npm";
5827
5827
  try {
@@ -5853,7 +5853,7 @@ ${C.yellow}The runner will not update itself: ${installErr.message}${C.reset}
5853
5853
  let serviceUp = false;
5854
5854
  let restart;
5855
5855
  if (installedLayout) {
5856
- const { installServiceCommand } = await import('./command-IJ7NRXFE.js');
5856
+ const { installServiceCommand } = await import('./command-YD3EHTZQ.js');
5857
5857
  const service = await installServiceCommand({
5858
5858
  configPath,
5859
5859
  entryPath: process.argv[1] ?? "",
@@ -5999,10 +5999,10 @@ A repository with no devcontainer file builds on the universal image the CLI pin
5999
5999
  await requestStop(configPath, Boolean(opts.now), void 0, { image: runnerImageVersion() !== void 0 });
6000
6000
  });
6001
6001
  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) => {
6002
- const { defaultRunnerConfigPath, loadRunnerConfig } = await import('./config-PFQRCT5B.js');
6002
+ const { builtinKind, defaultRunnerConfigPath, loadRunnerConfig } = await import('./config-PFQRCT5B.js');
6003
6003
  const { jobsDir, runnerDir } = await import('./paths-BZKRN5J3.js');
6004
6004
  const { listJobFiles, runnerProcessState } = await import('./loop-K53YB3BL.js');
6005
- const { renderStatus } = await import('./status-R7MMPMJJ.js');
6005
+ const { renderStatus } = await import('./status-GPSPNHZ3.js');
6006
6006
  const { readHousekeepingRecord } = await import('./record-ABSHWHSO.js');
6007
6007
  const path2 = await import('path');
6008
6008
  const configPath = opts.config ?? defaultRunnerConfigPath();
@@ -6015,6 +6015,7 @@ A repository with no devcontainer file builds on the universal image the CLI pin
6015
6015
  let host = "unknown";
6016
6016
  let concurrency = 1;
6017
6017
  let fleet;
6018
+ let buildsInSandboxes = false;
6018
6019
  try {
6019
6020
  const config = loadRunnerConfig(configPath);
6020
6021
  host = config.host;
@@ -6023,15 +6024,15 @@ A repository with no devcontainer file builds on the universal image the CLI pin
6023
6024
  const { readFleetState } = await import('./state-RZ2GSI4R.js');
6024
6025
  fleet = { state: readFleetState(configPath) };
6025
6026
  }
6027
+ buildsInSandboxes = builtinKind(config.hooks.provision) === "sandbox";
6026
6028
  } catch {
6027
6029
  }
6028
6030
  const processState = runnerProcessState(configPath);
6029
6031
  const service = await (async () => {
6030
6032
  if (process.platform === "darwin") {
6031
- const { sandboxAgentStatus } = await import('./launch-agent-NC7OZQGZ.js');
6033
+ const { launchAgentServiceState } = await import('./launch-agent-2PRVA5EX.js');
6032
6034
  const { realLaunchAgentHost } = await import('./launch-agent-host-VVMPSX3S.js');
6033
- const agent = sandboxAgentStatus(configPath, homeFromEnv(), realLaunchAgentHost());
6034
- return agent === void 0 ? void 0 : { unit: agent.label, running: agent.loaded, delegated: void 0, kind: "launch-agent" };
6035
+ return launchAgentServiceState({ configPath, home: homeFromEnv(), buildsInSandboxes }, realLaunchAgentHost());
6035
6036
  }
6036
6037
  if (process.platform !== "linux" || !existsSync("/run/systemd/system")) return void 0;
6037
6038
  const { inspectRunnerService } = await import('./find-unit-VUV76BIL.js');
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { realOwnership, accountNamed, handOver, runRunnerInstall, launcherSummary, restartNote, accountIdentity } from './chunk-TTHF4LOS.js';
4
- import { installSandboxAgent, uninstallSandboxAgent } from './chunk-HMVOTDEQ.js';
3
+ import { realOwnership, accountNamed, handOver, runRunnerInstall, launcherSummary, restartNote, accountIdentity } from './chunk-JOZ7SU5V.js';
4
+ import { installSandboxAgent, uninstallSandboxAgent } from './chunk-DFWIJH6P.js';
5
5
  import './chunk-TXKHD4Q6.js';
6
6
  import { realLaunchAgentHost } from './chunk-3FCYURWW.js';
7
7
  import { installHelper, helperUnitFor, helperSocketFor, uninstallHelper } from './chunk-AUJPQVNR.js';
8
- import './chunk-Y2US5RDK.js';
8
+ import './chunk-S4XEMYAP.js';
9
9
  import { currentLink, execStartCommand } from './chunk-WR2TR6BC.js';
10
10
  import { detectMachine, ensureFirecrackerAndJailer } from './chunk-ND5SOLPS.js';
11
11
  import './chunk-BY4SXNUL.js';
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { managedProblems, fleetConfigProblem, askFleetMachine } from './chunk-WYJSHRD6.js';
4
4
  import { helperBinaryFor } from './chunk-AUJPQVNR.js';
5
- import { launcherCheck } from './chunk-Y2US5RDK.js';
5
+ import { launcherCheck } from './chunk-S4XEMYAP.js';
6
6
  import './chunk-WR2TR6BC.js';
7
7
  import { needsAgentCredential, agentCredentialCheck, detectMachine, supportsContainerBuilds, describeMachineDocker, MIN_ENGINE_MAJOR, reachDockerStep, supportsMicroVmBuilds, microVmArchSupported, microVmAssetsPinned, helperFirecrackerNote, probeHelper, helperSocketPath, KIND_LABEL, missingPermissionOf, missingPermissionFix } from './chunk-ND5SOLPS.js';
8
8
  import './chunk-BY4SXNUL.js';
package/dist/index.js CHANGED
@@ -25,5 +25,5 @@ var { runSubcommand } = await import('./agent-subcommand-PVTVR4VJ.js');
25
25
  var launcherCode = await runSubcommand(argv);
26
26
  if (launcherCode !== void 0) process.exit(launcherCode);
27
27
  (await import('./hook-fast-A5LADBOU.js')).recordLinkExitFailure(argv);
28
- var { runCli } = await import('./cli-WD3BPYUH.js');
28
+ var { runCli } = await import('./cli-RKATG6XY.js');
29
29
  await runCli(process.argv);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { summarizeChecks, summaryText, renderDoctorText } from './chunk-5MCLOGP5.js';
3
+ import { summarizeChecks, summaryText, renderDoctorText } from './chunk-G6WWNIAY.js';
4
4
  import { shellFunctionInstalled, removeShellFunction, installShellFunction, SHELL_FUNCTION_LINE } from './chunk-IRFN2ZHJ.js';
5
5
  import './chunk-ADXJXXGU.js';
6
6
  import './chunk-UDFHJ4KG.js';
@@ -1,9 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { RunnerDowngradeError, RunnerInstallError, launcherSummary, restartNote, runRunnerInstall } from './chunk-TTHF4LOS.js';
4
- import './chunk-Y2US5RDK.js';
3
+ export { RunnerDowngradeError, RunnerInstallError, launcherSummary, restartNote, runRunnerInstall } from './chunk-JOZ7SU5V.js';
4
+ import './chunk-S4XEMYAP.js';
5
5
  import './chunk-WR2TR6BC.js';
6
6
  import './chunk-TQMI335S.js';
7
+ import './chunk-MP6INWPC.js';
8
+ import './chunk-ST5S3P2C.js';
9
+ import './chunk-3WYPBALP.js';
10
+ import './chunk-DF2ATCBQ.js';
11
+ import './chunk-D5YKPIHV.js';
7
12
  import './chunk-2OSEUHWY.js';
8
13
  import './chunk-IB4SVQNB.js';
9
14
  import './chunk-PUUQKA3W.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- export { installSandboxAgent, sandboxAgentStatus, uninstallSandboxAgent } from './chunk-HMVOTDEQ.js';
3
+ export { installSandboxAgent, launchAgentServiceState, sandboxAgentStatus, uninstallSandboxAgent } from './chunk-DFWIJH6P.js';
4
4
  import './chunk-TXKHD4Q6.js';
5
5
  import './chunk-WR2TR6BC.js';
6
6
  import './chunk-PNZMJFVP.js';
@@ -165,7 +165,7 @@ function renderStatus(input) {
165
165
  lines.push(header);
166
166
  if (input.service !== void 0) {
167
167
  const { unit, running: running2, delegated, kind } = input.service;
168
- if (kind === "launch-agent") lines.push(`launch agent ${unit} ${running2 ? "loaded" : "not loaded"}`);
168
+ if (kind === "launch-agent") lines.push(unit === void 0 ? "launch agent not installed" : `launch agent ${unit} ${running2 ? "loaded" : "not loaded"}`);
169
169
  else lines.push(`service ${unit} ${running2 ? "running" : "stopped"}${delegated === false ? " \xB7 not delegated: microVM builds have no memory limit of their own" : ""}`);
170
170
  }
171
171
  lines.push(...fleetLines(input));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outerlayer/cli",
3
- "version": "0.40.0-next.20261115012015",
3
+ "version": "0.40.0-next.20261115013314",
4
4
  "description": "OuterLayer CLI — commands: init, claude, opencode, connect, doctor, login, logout, sync, daemon (alias: watch), emit, demo, findings, work, run, 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.",