@outerlayer/cli 0.22.1 → 0.22.2

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +4 -1
  3. package/dist/{agent-setup-LTSLXPS3.js → agent-setup-KXPDPTAJ.js} +3 -4
  4. package/dist/bridge-QFN3KJP6.js +8 -0
  5. package/dist/build-info.json +1 -1
  6. package/dist/{check-UYKEMQNR.js → check-N6WLZCER.js} +21 -21
  7. package/dist/{chunk-7FEY33MY.js → chunk-2CPOAPU4.js} +8 -8
  8. package/dist/{chunk-BOMRFYTZ.js → chunk-4542B3RR.js} +2 -2
  9. package/dist/{chunk-O6RJ3QMU.js → chunk-4OYKJJ2V.js} +1 -1
  10. package/dist/{chunk-QOALB6ZD.js → chunk-B42BIYC6.js} +2 -2
  11. package/dist/{chunk-3V5C64Y5.js → chunk-BVR6MQLS.js} +2 -3
  12. package/dist/{chunk-IZSVXRDR.js → chunk-DXDF43YG.js} +1 -1
  13. package/dist/{chunk-F7CU5ABH.js → chunk-DYEFPYME.js} +1 -1
  14. package/dist/{chunk-JRCSET55.js → chunk-EMUNEAQK.js} +3 -3
  15. package/dist/{chunk-BET347JZ.js → chunk-FQE5RDHI.js} +4 -5
  16. package/dist/{chunk-FRNYCJ4W.js → chunk-FVDVC2GF.js} +1 -1
  17. package/dist/{chunk-5QRP3MVS.js → chunk-GNPTU4BM.js} +9 -4
  18. package/dist/{chunk-QC72I5GQ.js → chunk-HWZCE745.js} +2 -2
  19. package/dist/{chunk-CUFFDEF3.js → chunk-IMCVQF5F.js} +3 -3
  20. package/dist/{chunk-ENTHEUKT.js → chunk-IPS2JCHK.js} +3 -3
  21. package/dist/{chunk-56X5TOJY.js → chunk-JD6GWYY7.js} +2 -3
  22. package/dist/{chunk-FOCML5FI.js → chunk-KOIMUHIS.js} +8 -7
  23. package/dist/chunk-QS43O4DR.js +113 -0
  24. package/dist/{chunk-ORNJJ7XN.js → chunk-QZX6DAAW.js} +7 -8
  25. package/dist/{chunk-JZGFDTNC.js → chunk-SFHR45FA.js} +19 -2
  26. package/dist/{chunk-6YBLN4TR.js → chunk-SNVXHNU7.js} +1 -2
  27. package/dist/{chunk-URAKVDSI.js → chunk-U6RKHNC7.js} +5 -6
  28. package/dist/{chunk-5NJIWKD4.js → chunk-WKSBSEWT.js} +2 -2
  29. package/dist/chunk-WXJXHZVB.js +73 -0
  30. package/dist/{chunk-ZPSLJFGL.js → chunk-ZCXP35T3.js} +2 -2
  31. package/dist/{claude-launcher-TBWV3YL3.js → claude-launcher-QD3C427Y.js} +1 -1
  32. package/dist/{cli-U253V422.js → cli-A2Y67WAB.js} +69 -62
  33. package/dist/{command-IQTPFSXY.js → command-Q5Q2EIO4.js} +8 -9
  34. package/dist/{connect-cmd-ZFOK6HEL.js → connect-cmd-TNGEIWCA.js} +7 -2
  35. package/dist/{control-plane-launch-OWSNH6YA.js → control-plane-launch-HE6OSWKO.js} +2 -3
  36. package/dist/{doctor-FZTS57ZO.js → doctor-BRN4BGMA.js} +10 -11
  37. package/dist/{emit-artifact-cmd-YLZ5WLSF.js → emit-artifact-cmd-GPAJCCUC.js} +9 -9
  38. package/dist/{emit-criteria-cmd-MF6TVE7C.js → emit-criteria-cmd-R3FKHSQG.js} +4 -4
  39. package/dist/{emit-finding-cmd-S3YMFTZT.js → emit-finding-cmd-IK7RAVP5.js} +4 -4
  40. package/dist/{emit-result-cmd-JHEUFTPX.js → emit-result-cmd-5FJTF7YD.js} +9 -9
  41. package/dist/{emit-step-cmd-TUI2T3DS.js → emit-step-cmd-VRTD5YPP.js} +5 -5
  42. package/dist/{governing-source-XSEIRSBE.js → governing-source-WM736XR4.js} +6 -7
  43. package/dist/{guest-init-DF7V5D2R.js → guest-init-2OZ4YC7R.js} +2 -1
  44. package/dist/{hook-fast-O3UUN6SO.js → hook-fast-QUGEI2IT.js} +1 -1
  45. package/dist/{hook-wrap-fast-NPLHJXFK.js → hook-wrap-fast-NOOGDNSW.js} +2 -2
  46. package/dist/index.js +6 -6
  47. package/dist/{init-VZE72CR4.js → init-U3I43XCP.js} +9 -10
  48. package/dist/{init-ZZZPYGUH.js → init-X7FCQDFX.js} +9 -10
  49. package/dist/{init-cmd-W5VV62ZN.js → init-cmd-VCKH2DUQ.js} +10 -11
  50. package/dist/{init-update-YFPIQS5G.js → init-update-TCMH7M3Q.js} +4 -5
  51. package/dist/{loop-6WENRS5S.js → loop-P3QDQOE5.js} +21 -21
  52. package/dist/{machine-M4MQBV5A.js → machine-EEFOW32K.js} +8 -9
  53. package/dist/{mcp-serve-cmd-SBW7HYKD.js → mcp-serve-cmd-TQSPFRC7.js} +2 -2
  54. package/dist/{runner-key-QT7GKGEE.js → runner-key-O42EUXQU.js} +9 -10
  55. package/dist/{session-sender-BK6TGNVO.js → session-sender-HF6DXFA2.js} +10 -10
  56. package/dist/{settings-J2652U5N.js → settings-AKYEOCC2.js} +1 -1
  57. package/dist/{spec-cmd-ZNJ3GXWC.js → spec-cmd-ADPH236D.js} +5 -5
  58. package/dist/{status-JOO7MGIC.js → status-LXFIVGP3.js} +16 -16
  59. package/dist/{statusline-fast-2OK3DVAA.js → statusline-fast-GVRSBHAF.js} +2 -2
  60. package/dist/{sync-cmd-W2FPY3T5.js → sync-cmd-5XS3CUV5.js} +9 -9
  61. package/dist/{watch-WLH5ZUZU.js → watch-FBZHZV56.js} +9 -9
  62. package/dist/{work-claim-cmd-4PLDTEZR.js → work-claim-cmd-LIIINECF.js} +7 -7
  63. package/dist/{work-cmd-KWHAYUYB.js → work-cmd-SM6DY2WK.js} +5 -5
  64. package/dist/{work-comment-cmd-4CUI7ZDE.js → work-comment-cmd-VYVXGT4W.js} +5 -5
  65. package/dist/{work-logs-cmd-AF253WLM.js → work-logs-cmd-XZSCWWMW.js} +5 -5
  66. package/dist/{work-open-pr-cmd-JETE6HRL.js → work-open-pr-cmd-YZNC3P3R.js} +6 -6
  67. package/dist/{work-pr-cmd-V5G4CPMG.js → work-pr-cmd-AMN23KFJ.js} +5 -5
  68. package/dist/{work-stop-cmd-FIEKUDGE.js → work-stop-cmd-HSR2GOJJ.js} +5 -5
  69. package/package.json +1 -1
  70. package/skill-pack/maintained/outerlayer-amend/SKILL.md +83 -82
  71. package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -2
  72. package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +10 -3
  73. package/skill-pack/maintained/outerlayer-build/references/release.md +7 -4
  74. package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +6 -3
  75. package/skill-pack/maintained/outerlayer-cli/SKILL.md +8 -1
  76. package/skill-pack/maintained/outerlayer-cli/references/merge-base-branch.md +54 -0
  77. package/dist/chunk-NTRCK4NH.js +0 -38
  78. package/dist/chunk-QF7WZUU6.js +0 -56
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
+ import { BRIDGE_ADDRESS, TUNNEL_PORT, BRIDGE_CIDR } from './chunk-WXJXHZVB.js';
3
4
  import { EXEC_PORT } from './chunk-2Q3PZ42G.js';
4
5
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
6
  import { RELAY_PORT } from './chunk-URWYRAIC.js';
@@ -12,6 +13,7 @@ var HELPER_RECORD = "/run/outerlayer-helpers";
12
13
  var KERNEL_FLAG = "outerlayer.relay";
13
14
  var DOCKER_FLAG = "outerlayer.docker";
14
15
  var DOCKERD_CONFIG = "/run/outerlayer-dockerd.json";
16
+ var NONLOCAL_BIND = "/proc/sys/net/ipv4/ip_nonlocal_bind";
15
17
  var DOCKERD_LOG = "/run/dockerd.log";
16
18
  var DOCKER_DATA_ROOT = "/build/docker";
17
19
  var BUILD_DISK = "/dev/vdb";
@@ -32,13 +34,25 @@ function relayPortsFrom(cmdline) {
32
34
  function dockerRequestedBy(cmdline) {
33
35
  return new RegExp(`(?:^|\\s)${DOCKER_FLAG.replace(".", "\\.")}=1(?:\\s|$)`).test(cmdline);
34
36
  }
37
+ function startBridgeForwarder(host) {
38
+ host.writeFile(NONLOCAL_BIND, "1");
39
+ host.spawnDetached([
40
+ "/opt/outerlayer/bin/node",
41
+ "/opt/outerlayer/cli/dist/index.js",
42
+ "vm-forward",
43
+ "--listen",
44
+ `${BRIDGE_ADDRESS}:${TUNNEL_PORT}`,
45
+ "--to",
46
+ `127.0.0.1:${TUNNEL_PORT}`
47
+ ]);
48
+ }
35
49
  function startDocker(host) {
36
50
  const proxy = `http://127.0.0.1:${RELAY_PORT}`;
37
51
  host.mount({ source: "cgroup2", target: "/sys/fs/cgroup", type: "cgroup2" });
38
52
  host.mkdir(DOCKER_DATA_ROOT, 457);
39
53
  host.writeFile(
40
54
  DOCKERD_CONFIG,
41
- `${JSON.stringify({ "data-root": DOCKER_DATA_ROOT, proxies: { "http-proxy": proxy, "https-proxy": proxy, "no-proxy": "localhost,127.0.0.1" } }, null, 2)}
55
+ `${JSON.stringify({ "data-root": DOCKER_DATA_ROOT, bip: BRIDGE_CIDR, proxies: { "http-proxy": proxy, "https-proxy": proxy, "no-proxy": "localhost,127.0.0.1" } }, null, 2)}
42
56
  `
43
57
  );
44
58
  host.spawnDetached(["/bin/sh", "-c", `exec dockerd --config-file ${DOCKERD_CONFIG} >${DOCKERD_LOG} 2>&1`]);
@@ -65,7 +79,10 @@ function runGuestInit(host, cmdline) {
65
79
  host.writeFile("/proc/sys/kernel/hostname", HOSTNAME);
66
80
  host.mount({ source: "tmpfs", target: "/outerlayer/job", type: "tmpfs", options: "mode=0755" });
67
81
  const relay = host.spawnDetached([HELPER_PATH, "relay", ...ports.flatMap((port) => ["--forward", String(port)])]);
68
- if (dockerRequestedBy(cmdline)) startDocker(host);
82
+ if (dockerRequestedBy(cmdline)) {
83
+ startBridgeForwarder(host);
84
+ startDocker(host);
85
+ }
69
86
  const agent = host.spawnDetached([HELPER_PATH, "exec-agent", "--port", String(EXEC_PORT)]);
70
87
  host.writeFile(HELPER_RECORD, [relay, agent].map((started) => `${started.pid} ${started.start}
71
88
  `).join(""));
@@ -1,8 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { removeRetiredSkills } from './chunk-USWVXQIH.js';
4
- import { defaultFetch } from './chunk-QF7WZUU6.js';
5
- import { resolveGatewayCredentials } from './chunk-NTRCK4NH.js';
4
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-QS43O4DR.js';
6
5
  import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
7
6
  import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-5OCIHFGE.js';
8
7
  import { cliInvocation } from './chunk-CRB3POP4.js';
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { uploadSpooledSteps } from './chunk-56X5TOJY.js';
3
+ import { uploadSpooledSteps } from './chunk-JD6GWYY7.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-G3IJ3N6F.js';
7
- import { defaultFetch } from './chunk-QF7WZUU6.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
9
- import { writeSyncStatus, spoolDir } from './chunk-QC72I5GQ.js';
7
+ import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-QS43O4DR.js';
8
+ import { writeSyncStatus, spoolDir } from './chunk-HWZCE745.js';
10
9
  import { readLatestProvenanceForSession, readContextProvenance } from './chunk-ZJSNLVCE.js';
11
- import { hookExecSpoolPath } from './chunk-F7CU5ABH.js';
10
+ import { hookExecSpoolPath } from './chunk-DYEFPYME.js';
12
11
  import { applyReportedCost } from './chunk-BKO6JEZI.js';
13
12
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
14
13
  import { setCustomScrubbers, setLocalIdentity, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, sessionIdFromPath, scrubDeep, SOURCE_ADAPTERS } from './chunk-AEKSX4EY.js';
@@ -573,7 +572,7 @@ var LiveUploader = class {
573
572
  this.stopped = false;
574
573
  this.warned = /* @__PURE__ */ new Set();
575
574
  this.home = opts.home;
576
- this.fetchImpl = opts.fetchImpl ?? fetch;
575
+ this.fetchImpl = opts.fetchImpl ?? cliFetch;
577
576
  this.sleepImpl = opts.sleepImpl ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
578
577
  this.debounceMs = opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
579
578
  this.env = opts.env ?? process.env;
@@ -6,8 +6,8 @@ import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LA
6
6
  import { RecipeError, CLAUDE_CODE_VERSION, firecrackerArch, MICROVM_ARCHES, DEFAULT_BASE_IMAGE, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GUEST_ASSETS_VERSION } from './chunk-3W333NFO.js';
7
7
  import { execCapture } from './chunk-NYTZ7HVN.js';
8
8
  import { GUEST_CID } from './chunk-2Q3PZ42G.js';
9
- import { describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-CUFFDEF3.js';
10
- import { WorkCommandError } from './chunk-BET347JZ.js';
9
+ import { describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-IMCVQF5F.js';
10
+ import { WorkCommandError } from './chunk-FQE5RDHI.js';
11
11
  import { hostAllowed } from './chunk-UXYLWVTQ.js';
12
12
  import { parseDuKilobytes } from './chunk-7RQ73DLO.js';
13
13
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { RELAY_PORT, BUILD_HOME } from './chunk-URWYRAIC.js';
4
+ import { createServer, connect } from 'net';
5
+
6
+ createRequire(import.meta.url);
7
+ var BRIDGE_ADDRESS = "172.17.0.1";
8
+ var BRIDGE_CIDR = "172.17.0.1/16";
9
+ var TUNNEL_PORT = RELAY_PORT;
10
+ var CONTAINER_PROXY = `http://${BRIDGE_ADDRESS}:${TUNNEL_PORT}`;
11
+ var CONTAINER_NO_PROXY = ["localhost", "127.0.0.1", "::1", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"];
12
+ function dockerClientConfig() {
13
+ const proxies = { default: { httpProxy: CONTAINER_PROXY, httpsProxy: CONTAINER_PROXY, noProxy: CONTAINER_NO_PROXY.join(",") } };
14
+ return `${JSON.stringify({ proxies }, null, 2)}
15
+ `;
16
+ }
17
+ async function writeDockerClientConfig(run, agentUser) {
18
+ const dir = `${BUILD_HOME}/.docker`;
19
+ const script = [
20
+ "set -e",
21
+ "umask 077",
22
+ `mkdir -p ${dir}`,
23
+ `cat > ${dir}/config.json.partial`,
24
+ `mv ${dir}/config.json.partial ${dir}/config.json`,
25
+ `chown "$(id -u "$1"):$(id -g "$1")" ${dir} ${dir}/config.json`,
26
+ `chmod 700 ${dir}`,
27
+ `chmod 600 ${dir}/config.json`
28
+ ].join("\n");
29
+ const result = await run(["/bin/sh", "-c", script, "sh", agentUser], dockerClientConfig());
30
+ if (result.status === 0) return void 0;
31
+ return `the Docker client configuration could not be written in the microVM (exit ${result.status}): ${result.stderr.trim().split("\n")[0]}`;
32
+ }
33
+ function parseAddress(text) {
34
+ const match = /^(.+):(\d+)$/.exec(text);
35
+ const port = Number(match?.[2]);
36
+ if (match === null || port > 65535) throw new Error(`${JSON.stringify(text)} is not host:port`);
37
+ return { host: match[1], port };
38
+ }
39
+ async function startBridgeForward(opts) {
40
+ const listen = parseAddress(opts.listen);
41
+ const to = parseAddress(opts.to);
42
+ const open = /* @__PURE__ */ new Set();
43
+ const server = createServer({ allowHalfOpen: true }, (client) => {
44
+ const upstream = connect({ host: to.host, port: to.port, allowHalfOpen: true });
45
+ open.add(client);
46
+ client.on("error", () => void 0);
47
+ upstream.on("error", () => void 0);
48
+ client.on("close", () => {
49
+ open.delete(client);
50
+ upstream.destroy();
51
+ });
52
+ upstream.on("close", () => client.destroy());
53
+ client.pipe(upstream);
54
+ upstream.pipe(client);
55
+ });
56
+ await new Promise((resolve, reject) => {
57
+ server.once("error", reject);
58
+ server.listen(listen.port, listen.host, () => {
59
+ resolve();
60
+ });
61
+ });
62
+ server.on("error", (error) => process.stderr.write(`outerlayer: the bridge forwarder hit an error: ${error.message}
63
+ `));
64
+ return {
65
+ port: server.address().port,
66
+ close: () => new Promise((resolve) => {
67
+ for (const socket of open) socket.destroy();
68
+ server.close(() => resolve());
69
+ })
70
+ };
71
+ }
72
+
73
+ export { BRIDGE_ADDRESS, BRIDGE_CIDR, CONTAINER_NO_PROXY, CONTAINER_PROXY, TUNNEL_PORT, dockerClientConfig, startBridgeForward, writeDockerClientConfig };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-4AVDD7VX.js';
4
- import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-FRNYCJ4W.js';
5
- import { MIN_ENGINE_MAJOR } from './chunk-5NJIWKD4.js';
4
+ import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-FVDVC2GF.js';
5
+ import { MIN_ENGINE_MAJOR } from './chunk-WKSBSEWT.js';
6
6
  import { runnerCredentialProblem } from './chunk-V5CG75NX.js';
7
7
  import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
8
8
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
@@ -236,7 +236,7 @@ async function runClaudeLauncher(args, deps = {}) {
236
236
  return 1;
237
237
  }
238
238
  } else {
239
- const { resolveLaunchPlane } = await import('./control-plane-launch-OWSNH6YA.js');
239
+ const { resolveLaunchPlane } = await import('./control-plane-launch-HE6OSWKO.js');
240
240
  const plane = env[GOVERNANCE_VARIABLE] === "self" ? { kind: "none" } : await resolveLaunchPlane({ cwd, env, home, fetchImpl: deps.fetchImpl, stderr });
241
241
  if (plane.kind === "none") {
242
242
  const own2 = ownSkillsDirFor(cwd, home, [], stderr);