@outerlayer/cli 0.34.0-next.20261027193835 → 0.34.0-next.20261028010245

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 (120) hide show
  1. package/dist/{agent-setup-THDNZ5ME.js → agent-setup-6FPE6EYN.js} +6 -6
  2. package/dist/{bridge-MLB57JP6.js → bridge-JGIHPGMY.js} +2 -2
  3. package/dist/{build-25GDCEZ7.js → build-AAQ4PVP2.js} +9 -9
  4. package/dist/{build-disk-NFMQCZM3.js → build-disk-L7JRQA22.js} +7 -7
  5. package/dist/build-info.json +1 -1
  6. package/dist/{builder-OWDGC3VQ.js → builder-LMLAVVVF.js} +6 -6
  7. package/dist/{check-IFHLERRX.js → check-C7UKLYZQ.js} +38 -38
  8. package/dist/{chunk-JO4SAEHH.js → chunk-23XAA7YD.js} +2 -2
  9. package/dist/{chunk-7SJNVGVC.js → chunk-32FAPJFD.js} +5 -5
  10. package/dist/{chunk-4HA4S3U2.js → chunk-3E7QAXUW.js} +152 -7
  11. package/dist/{chunk-3FTIUB7I.js → chunk-3X6OSXSB.js} +1 -1
  12. package/dist/{chunk-3RRYEZAC.js → chunk-3XOLOV5A.js} +3 -3
  13. package/dist/{chunk-PMIW6OGQ.js → chunk-4A5OJOCR.js} +9 -9
  14. package/dist/{chunk-NO6E72RM.js → chunk-4J5GRWAY.js} +1 -1
  15. package/dist/{chunk-4QQJTJUN.js → chunk-57WFXHCB.js} +1 -1
  16. package/dist/{chunk-36M4KVBT.js → chunk-5IUC2B6J.js} +2 -2
  17. package/dist/{chunk-7TLGRE5F.js → chunk-5LUN7TTR.js} +2 -2
  18. package/dist/{chunk-OP2L7OXA.js → chunk-6LS62EO4.js} +3 -3
  19. package/dist/{chunk-FVVHQIZR.js → chunk-6OLXDSQ6.js} +1 -1
  20. package/dist/{chunk-AV5T7HV3.js → chunk-6Q7O4MRI.js} +1 -1
  21. package/dist/{chunk-UZIAZXXO.js → chunk-77D5ENBA.js} +1 -1
  22. package/dist/{chunk-FLHBUQ2W.js → chunk-AHWMY3MS.js} +155 -10
  23. package/dist/{chunk-3VJYDWFV.js → chunk-AJTGTSNA.js} +1 -1
  24. package/dist/{chunk-5FHBVV25.js → chunk-BQ4C47K2.js} +7 -7
  25. package/dist/{chunk-EYJRVHBN.js → chunk-BTDBDTUY.js} +2 -2
  26. package/dist/{chunk-X7M73LKT.js → chunk-CM4J53WZ.js} +1 -1
  27. package/dist/{chunk-WX2HW2G2.js → chunk-D3CT6XQ4.js} +10 -3
  28. package/dist/{chunk-HJCNWEQK.js → chunk-D6SH7DWA.js} +2 -2
  29. package/dist/{chunk-LYX2RRSF.js → chunk-EGJY6MBC.js} +2 -2
  30. package/dist/{chunk-T6ALNN3H.js → chunk-F3BGTGQC.js} +1 -1
  31. package/dist/{chunk-BS3OYFAD.js → chunk-G4SOMWXL.js} +1 -1
  32. package/dist/{chunk-BS4CZMT6.js → chunk-GET5HKLM.js} +1 -1
  33. package/dist/{chunk-6IMQXBTZ.js → chunk-GJYGOFF3.js} +5 -5
  34. package/dist/{chunk-Y4WJ4BLX.js → chunk-GMEXR6PY.js} +6 -6
  35. package/dist/{chunk-JWMJMQRF.js → chunk-GXMMILQ4.js} +4 -4
  36. package/dist/{chunk-S5U6RKQX.js → chunk-HFMK2R7O.js} +99 -179
  37. package/dist/{chunk-WR2GRWK3.js → chunk-I4YOWQH7.js} +1 -1
  38. package/dist/{chunk-QRIE4JZE.js → chunk-JXY66VYX.js} +2 -2
  39. package/dist/{chunk-CMMEJJTL.js → chunk-KTVZ7TZY.js} +2 -2
  40. package/dist/{chunk-GMKDAF37.js → chunk-L2OARQKP.js} +17 -98
  41. package/dist/{chunk-CFJOONWM.js → chunk-LBKCYEJT.js} +1 -1
  42. package/dist/{chunk-OHTMTMFX.js → chunk-NBETYM32.js} +4 -4
  43. package/dist/{chunk-MXAYUZJF.js → chunk-NCKH3KCM.js} +5 -5
  44. package/dist/{chunk-RCAMBC3H.js → chunk-NOEJGR4X.js} +2 -2
  45. package/dist/{chunk-62URQYCB.js → chunk-PAGB3DCI.js} +1 -1
  46. package/dist/{chunk-Y7MF32DM.js → chunk-PBI4CM4M.js} +67 -60
  47. package/dist/{chunk-JVNQNKHV.js → chunk-PHIQHIRJ.js} +1 -1
  48. package/dist/{chunk-7Q7GQELE.js → chunk-PPQTTJSW.js} +5 -5
  49. package/dist/{chunk-GPO7F757.js → chunk-QJ2SNBHL.js} +1 -1
  50. package/dist/{chunk-W246VXU4.js → chunk-QNF7LT7W.js} +2 -2
  51. package/dist/{chunk-Z4LFCJT6.js → chunk-SWCOWG2C.js} +2 -2
  52. package/dist/{chunk-SKAML7GB.js → chunk-SYMBXSAT.js} +3 -3
  53. package/dist/{chunk-5ARXP3BP.js → chunk-UEDRRWZ3.js} +3 -3
  54. package/dist/{chunk-LSFP57LI.js → chunk-VB4QD4WN.js} +273 -122
  55. package/dist/{chunk-RJZZFAXS.js → chunk-VKYU4HHW.js} +1 -1
  56. package/dist/{chunk-2YPOSVC7.js → chunk-WEQMLC7P.js} +3 -3
  57. package/dist/{chunk-ANFNZCXZ.js → chunk-WSVE5QGL.js} +4 -4
  58. package/dist/{claude-launcher-LYGS66AC.js → claude-launcher-GGZEWVYJ.js} +1 -1
  59. package/dist/{cli-7S4PEKAV.js → cli-IG52447Q.js} +110 -110
  60. package/dist/{command-GQVFZHJ2.js → command-NSTOWAZ6.js} +26 -26
  61. package/dist/{config-5NWSCHIO.js → config-YPUOOZB6.js} +8 -8
  62. package/dist/{connect-cmd-HB3K3AHE.js → connect-cmd-RPEEANNE.js} +5 -5
  63. package/dist/{container-start-WRD3YZQR.js → container-start-OOBTGHWF.js} +32 -32
  64. package/dist/{context-show-cmd-RJIQS2KF.js → context-show-cmd-R5WCECOT.js} +6 -6
  65. package/dist/{control-plane-launch-TS4DFJF4.js → control-plane-launch-55CJGYBK.js} +5 -5
  66. package/dist/{demo-record-cmd-VVZGUCWB.js → demo-record-cmd-SFOWQPL7.js} +4 -4
  67. package/dist/{demo-voice-cmd-3ADGIWK6.js → demo-voice-cmd-ZOBRVHOK.js} +12 -12
  68. package/dist/{docker-5VGCFZV2.js → docker-VPJW5LXB.js} +6 -6
  69. package/dist/{doctor-N4I6IEKP.js → doctor-O2EJAPZB.js} +70 -27
  70. package/dist/{emit-artifact-cmd-WJT7AXTZ.js → emit-artifact-cmd-HBFYBXJR.js} +10 -10
  71. package/dist/{emit-criteria-cmd-45IYB535.js → emit-criteria-cmd-TPUL7M2R.js} +7 -7
  72. package/dist/{emit-demo-cmd-AIIQNPXS.js → emit-demo-cmd-5CUT7W3R.js} +12 -12
  73. package/dist/{emit-finding-cmd-6YTJK2NA.js → emit-finding-cmd-IKHGMACP.js} +7 -7
  74. package/dist/{emit-result-cmd-TZGFY743.js → emit-result-cmd-F7CI6SNZ.js} +9 -9
  75. package/dist/{emit-step-cmd-LGBTIAXC.js → emit-step-cmd-DVEKGHK7.js} +7 -7
  76. package/dist/{exec-client-LR67CA24.js → exec-client-H2JG36OS.js} +3 -3
  77. package/dist/find-unit-ACTOZVVS.js +19 -0
  78. package/dist/{findings-cmd-ETJXUDQI.js → findings-cmd-ODKZ462L.js} +7 -7
  79. package/dist/{fleet-readiness-MYIMDBF7.js → fleet-readiness-UHCBNW6A.js} +5 -5
  80. package/dist/{governing-source-GBJTVMK2.js → governing-source-SRECHKPR.js} +9 -9
  81. package/dist/{guest-init-GXPOW53F.js → guest-init-6FUC4XZX.js} +4 -4
  82. package/dist/{hook-fast-5WOGLR7V.js → hook-fast-WM6YZVBJ.js} +1 -1
  83. package/dist/{host-checks-33ZTDTSH.js → host-checks-FLIHLR35.js} +30 -30
  84. package/dist/{pending-6DDSCXUD.js → host-key-OSWPVMIA.js} +3 -3
  85. package/dist/{image-tag-OYHGRHVV.js → image-tag-LF3NEGSL.js} +3 -3
  86. package/dist/index.js +4 -4
  87. package/dist/{init-OXCOPKHP.js → init-LPD75DCX.js} +23 -23
  88. package/dist/{init-2YOAKLDN.js → init-OX677NNB.js} +23 -23
  89. package/dist/{init-cmd-BUWWUQKM.js → init-cmd-ZCLVC5RR.js} +10 -10
  90. package/dist/{init-update-TXQHBY3H.js → init-update-POKSLQDQ.js} +8 -8
  91. package/dist/{install-cmd-VZGXSS73.js → install-cmd-6SQVZEXL.js} +5 -5
  92. package/dist/{logs-42QPBCMC.js → logs-QHXZTSKZ.js} +2 -2
  93. package/dist/{loop-M3XDFD6O.js → loop-ELTO36MN.js} +37 -37
  94. package/dist/{machine-3BI2SGAK.js → machine-7VPFAC6L.js} +23 -23
  95. package/dist/{mcp-serve-cmd-LYJQO6U4.js → mcp-serve-cmd-J32K42HM.js} +4 -4
  96. package/dist/{paths-QLFRPIKS.js → paths-4ZGWWNTG.js} +2 -2
  97. package/dist/{host-key-GAZM4EOH.js → pending-CRXJKKKI.js} +3 -3
  98. package/dist/{pidfile-WLZ427QQ.js → pidfile-VLZPRIBZ.js} +3 -3
  99. package/dist/{record-WGCMQLQS.js → record-4ZJPJTWO.js} +3 -3
  100. package/dist/{runner-env-6FSJOSWS.js → runner-env-W53VDVOK.js} +10 -10
  101. package/dist/{runner-identity-XODZ7YBP.js → runner-identity-BH42S2MU.js} +6 -6
  102. package/dist/{runner-key-KMTC4NCQ.js → runner-key-ESAZRV3A.js} +23 -23
  103. package/dist/{session-sender-U54EQJNR.js → session-sender-UB45MUKV.js} +10 -10
  104. package/dist/{spec-cmd-EM24GTAM.js → spec-cmd-H5B55O5L.js} +8 -8
  105. package/dist/{status-WVCQCBDQ.js → status-L2OYAZHY.js} +30 -30
  106. package/dist/{sync-cmd-Y5RKWVF7.js → sync-cmd-IWA5ZTI2.js} +9 -9
  107. package/dist/{update-steps-2D4YQAW2.js → update-steps-FWQ5ASZ6.js} +31 -31
  108. package/dist/{watch-X5VYY4LH.js → watch-NOEBVS6U.js} +9 -9
  109. package/dist/{work-claim-cmd-IU3YJQKR.js → work-claim-cmd-7P7U3OQ6.js} +14 -14
  110. package/dist/{work-cmd-LUKJHAMH.js → work-cmd-77GUT7LY.js} +7 -7
  111. package/dist/{work-comment-cmd-BDNFAVKL.js → work-comment-cmd-VS3BSPGM.js} +8 -8
  112. package/dist/{work-demo-cmd-GPDJHU6F.js → work-demo-cmd-S3GXBYIA.js} +7 -7
  113. package/dist/{work-logs-cmd-B6EX4RPE.js → work-logs-cmd-6BXIINCM.js} +7 -7
  114. package/dist/{work-open-pr-cmd-TRXDCMSG.js → work-open-pr-cmd-EPOFWJDC.js} +8 -8
  115. package/dist/{work-pr-cmd-5GUR5SIU.js → work-pr-cmd-DYSYOP74.js} +7 -7
  116. package/dist/{work-proofs-cmd-5BYAAW3H.js → work-proofs-cmd-DS2VX4E4.js} +8 -8
  117. package/dist/{work-proofs-record-USD4JWFP.js → work-proofs-record-LIQGUDWH.js} +15 -15
  118. package/dist/{work-stop-cmd-J47GZB2N.js → work-stop-cmd-HYQTDNUY.js} +7 -7
  119. package/package.json +1 -1
  120. package/dist/find-unit-YGDFVHVU.js +0 -19
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-X7M73LKT.js';
4
- import { universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-WX2HW2G2.js';
5
- import { ensureHostKey } from './chunk-RJZZFAXS.js';
3
+ import { resolveDevcontainerCli, devcontainerBuildInvocation, universalImagePending, RecipeError } from './chunk-CM4J53WZ.js';
4
+ import { universalImagePinned, UNIVERSAL_IMAGE, BUILDKIT_IMAGE } from './chunk-D3CT6XQ4.js';
5
+ import { ensureHostKey } from './chunk-VKYU4HHW.js';
6
6
  import { compareVersions } from './chunk-A6PJSNP6.js';
7
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-3VJYDWFV.js';
8
- import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-GMKDAF37.js';
7
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-AJTGTSNA.js';
8
+ import { CLAUDE_PORT, BUILD_HOME, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-L2OARQKP.js';
9
9
  import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-MESOOLF4.js';
10
10
  import { createHash } from 'crypto';
11
11
  import { mkdirSync, createWriteStream, rmSync, existsSync, readFileSync, chmodSync, writeFileSync, realpathSync, readdirSync, renameSync } from 'fs';
12
- import { dirname, join, resolve } from 'path';
12
+ import { dirname, join, posix, resolve } from 'path';
13
13
  import { StringDecoder } from 'string_decoder';
14
14
  import { spawn } from 'child_process';
15
15
 
@@ -454,6 +454,65 @@ var HASH_ARGV = ["/opt/outerlayer/bin/node", "-e", HASH_SCRIPT, JUDGE_PROGRAM];
454
454
  function parseProgramHash(stdout) {
455
455
  return /^([0-9a-f]{64}) /.exec(stdout.trim())?.[1];
456
456
  }
457
+ function within(path, folder) {
458
+ return path === folder || path.startsWith(`${folder}/`);
459
+ }
460
+ function mountableHome(home) {
461
+ const kept = ["/opt/outerlayer", "/usr/local/bin", "/outerlayer", "/etc", "/usr", "/bin", "/sbin", "/lib", "/var/run"];
462
+ const kernel = ["/proc", "/sys", "/dev", "/run"];
463
+ const writable = ["/build", "/tmp"];
464
+ if (home === void 0 || !home.startsWith("/") || /[",\n]/.test(home)) return void 0;
465
+ const path = posix.normalize(home).replace(/(.)\/+$/, "$1");
466
+ if (path === "/" || path === "/nonexistent") return void 0;
467
+ if (writable.some((folder) => within(path, folder)) || kernel.some((folder) => within(path, folder))) return void 0;
468
+ if (kept.some((folder) => within(folder, path) || within(path, folder))) return void 0;
469
+ return path;
470
+ }
471
+ function identityScript() {
472
+ return [
473
+ "const [want, file] = process.argv.slice(1);",
474
+ 'const rows = require("fs").readFileSync(file, "utf8").split("\\n").map((line) => line.split(":")).filter((f) => f.length >= 7);',
475
+ "const row = rows.find((f) => f[0] === want) ?? (/^\\d+$/.test(want) ? rows.find((f) => f[2] === want) : undefined);",
476
+ "process.stdout.write(JSON.stringify(row === undefined ? null : { uid: Number(row[2]), home: row[5] }));"
477
+ ].join("\n");
478
+ }
479
+ function identityArgs(user) {
480
+ return [user, "/etc/passwd"];
481
+ }
482
+ function parseIdentity(stdout) {
483
+ let parsed;
484
+ try {
485
+ parsed = JSON.parse(stdout);
486
+ } catch {
487
+ return void 0;
488
+ }
489
+ if (parsed === null) return null;
490
+ const { uid, home } = parsed;
491
+ return Number.isInteger(uid) && typeof home === "string" ? { uid, home } : void 0;
492
+ }
493
+ function homeCopyScript() {
494
+ return [
495
+ 'const fs = require("fs");',
496
+ "const [from, to] = process.argv.slice(1);",
497
+ "if (!fs.existsSync(from)) process.exit(0);",
498
+ "let skipped = 0;",
499
+ "const readable = (path) => {",
500
+ " try {",
501
+ " const stat = fs.lstatSync(path);",
502
+ " if (!stat.isFile() && !stat.isDirectory() && !stat.isSymbolicLink()) return false;",
503
+ " if (!stat.isSymbolicLink()) fs.accessSync(path, stat.isDirectory() ? fs.constants.R_OK | fs.constants.X_OK : fs.constants.R_OK);",
504
+ " return true;",
505
+ " } catch {",
506
+ " return false;",
507
+ " }",
508
+ "};",
509
+ "fs.cpSync(from, to, { recursive: true, force: false, errorOnExist: false, preserveTimestamps: true, verbatimSymlinks: true, filter: (path) => readable(path) || (skipped++, false) });",
510
+ "if (skipped > 0) process.stderr.write(`left out ${skipped} entries the build user cannot read\\n`);"
511
+ ].join("\n");
512
+ }
513
+ function homeCopyArgs(home) {
514
+ return [home, BUILD_HOME];
515
+ }
457
516
 
458
517
  // src/runner/container/run-args.ts
459
518
  var COMMAND_DIR = "/build/.command";
@@ -461,7 +520,7 @@ var BUILD_LABEL = "ai.outerlayer.build";
461
520
  function runnerLabelValue(configPath) {
462
521
  return readRunnerIdentity(configPath)?.label ?? pathLabelValue(configPath);
463
522
  }
464
- function hardened(input) {
523
+ function hardened(input, network) {
465
524
  const { memory, cpus, pids, cpuset } = input.limits;
466
525
  return [
467
526
  "--label",
@@ -469,7 +528,7 @@ function hardened(input) {
469
528
  "--label",
470
529
  `${RUNNER_LABEL}=${input.runnerId}`,
471
530
  "--network",
472
- "none",
531
+ network === void 0 ? "none" : `container:${network}`,
473
532
  "--cap-drop",
474
533
  "ALL",
475
534
  "--security-opt",
@@ -505,7 +564,7 @@ function containerRunArgs(input) {
505
564
  "--detach",
506
565
  "--name",
507
566
  input.container,
508
- ...hardened(exec ? { ...input, user: RELAY_USER } : input),
567
+ ...hardened(exec ? { ...input, user: RELAY_USER } : input, input.network),
509
568
  // Only the relay's user can open the folder the joining socket is in.
510
569
  ...exec ? ["--tmpfs", `${JOIN_DIR}:mode=0700,uid=${RELAY_ID},gid=${RELAY_ID}`] : [],
511
570
  "--mount",
@@ -513,6 +572,8 @@ function containerRunArgs(input) {
513
572
  // `/tmp` is a directory of the same volume, so it is measured and limited with the rest of the build.
514
573
  "--mount",
515
574
  `type=volume,src=${input.volume},dst=/tmp,volume-subpath=tmp`,
575
+ // A program that takes its home from `/etc/passwd`, as Java does, writes in the build's home too.
576
+ ...input.home === void 0 ? [] : ["--mount", `type=volume,src=${input.volume},dst=${mountPath(input.home)},volume-subpath=home`],
516
577
  ...copied ? [
517
578
  // Owned by the relay's user, who writes the files in; the agent can read them and cannot change them. `exec` so the commit hooks can run.
518
579
  "--tmpfs",
@@ -547,6 +608,67 @@ function containerRunArgs(input) {
547
608
  ] : []
548
609
  ];
549
610
  }
611
+ var NETWORK_HELPER_PROGRAM = "/opt/outerlayer/bin/outerlayer-guest";
612
+ var NETWORK_READY_FILE = "/run/outerlayer-net.ready";
613
+ var NAME_SERVER = "127.0.0.53";
614
+ var NETWORK_HELPER_MEMORY = "512m";
615
+ var NETWORK_HELPER_PIDS = 256;
616
+ function networkHelperName(container) {
617
+ return `${container}-net`;
618
+ }
619
+ function networkHelperRunArgs(input) {
620
+ return [
621
+ "--detach",
622
+ "--name",
623
+ input.name,
624
+ "--label",
625
+ `${BUILD_LABEL}=${input.buildId}`,
626
+ "--label",
627
+ `${RUNNER_LABEL}=${input.runnerId}`,
628
+ "--network",
629
+ "none",
630
+ "--cap-drop",
631
+ "ALL",
632
+ "--cap-add",
633
+ "NET_ADMIN",
634
+ "--device",
635
+ "/dev/net/tun",
636
+ "--security-opt",
637
+ "no-new-privileges",
638
+ "--read-only",
639
+ "--tmpfs",
640
+ "/run:mode=0755",
641
+ "--user",
642
+ "0:0",
643
+ "--dns",
644
+ NAME_SERVER,
645
+ ...input.ipv6 ? ["--sysctl", "net.ipv6.conf.all.disable_ipv6=1", "--sysctl", "net.ipv6.conf.default.disable_ipv6=1"] : [],
646
+ "--sysctl",
647
+ "net.ipv4.conf.all.rp_filter=0",
648
+ "--sysctl",
649
+ "net.ipv4.conf.default.rp_filter=0",
650
+ "--sysctl",
651
+ "net.ipv4.ip_unprivileged_port_start=0",
652
+ "--memory",
653
+ NETWORK_HELPER_MEMORY,
654
+ "--memory-swap",
655
+ NETWORK_HELPER_MEMORY,
656
+ ...input.limits.cpuset === void 0 ? [] : ["--cpuset-cpus", input.limits.cpuset],
657
+ "--pids-limit",
658
+ String(NETWORK_HELPER_PIDS),
659
+ "--entrypoint",
660
+ NETWORK_HELPER_PROGRAM,
661
+ input.image,
662
+ "net",
663
+ "--relay",
664
+ `127.0.0.1:${RELAY_PORT}`,
665
+ "--dns",
666
+ `${NAME_SERVER}:53`,
667
+ "--ready",
668
+ NETWORK_READY_FILE,
669
+ "--drop-privileges"
670
+ ];
671
+ }
550
672
  function prepareRunArgs(input) {
551
673
  return [
552
674
  "--rm",
@@ -565,6 +687,29 @@ function prepareRunArgs(input) {
565
687
  COMMAND_DIR
566
688
  ];
567
689
  }
690
+ function scriptRunArgs(input, script, args) {
691
+ return [
692
+ "--rm",
693
+ ...hardened(input),
694
+ "--mount",
695
+ `type=volume,src=${input.volume},dst=/build`,
696
+ // The image's own NODE_OPTIONS can require a module or name a flag this Node rejects, and the script needs none.
697
+ "--env",
698
+ "NODE_OPTIONS=",
699
+ "--entrypoint",
700
+ "/opt/outerlayer/bin/node",
701
+ input.image,
702
+ "-e",
703
+ script,
704
+ ...args
705
+ ];
706
+ }
707
+ function identityRunArgs(input, user) {
708
+ return scriptRunArgs(input, identityScript(), identityArgs(user));
709
+ }
710
+ function homeCopyRunArgs(input, home) {
711
+ return scriptRunArgs(input, homeCopyScript(), homeCopyArgs(home));
712
+ }
568
713
  function containerExecArgs(input) {
569
714
  const literals = Object.keys(input.env.literals).sort().flatMap((name) => ["-e", `${name}=${input.env.literals[name]}`]);
570
715
  const passed = Object.keys(input.env.passed).filter((name) => input.env.passed[name] !== void 0).sort().flatMap((name) => ["-e", name]);
@@ -717,4 +862,4 @@ function ensureBuilder(rawRun, spec, options = {}) {
717
862
  );
718
863
  }
719
864
 
720
- export { BUILD_LABEL, COMMAND_DIR, HASH_ARGV, JUDGE_DIR, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_PROGRAM, JUDGE_REPORT, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, RUNNER_LABEL, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, identityDockerFor, isOutOfMemory, judgeCommand, parseProgramHash, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
865
+ export { BUILD_LABEL, COMMAND_DIR, HASH_ARGV, JUDGE_DIR, JUDGE_ITEMS, JUDGE_MAX_TURNS, JUDGE_PROGRAM, JUDGE_REPORT, MAX_ITEMS_BYTES, MAX_REPORT_BYTES, MIN_BUILDX_VERSION, NETWORK_HELPER_MEMORY, NETWORK_READY_FILE, RUNNER_LABEL, builderName, builderNameFor, builderSpec, buildxState, childEnvironment, containerExecArgs, containerRunArgs, createDockerHost, dockerIdentity, ensureBuilder, ensureFailureCount, ensureRunnerIdentity, exceedsDisk, homeCopyArgs, homeCopyRunArgs, homeCopyScript, identityArgs, identityDockerFor, identityRunArgs, identityScript, isOutOfMemory, judgeCommand, mountableHome, networkHelperName, networkHelperRunArgs, parseIdentity, parseProgramHash, parseSize, pathLabelValue, prepareRunArgs, proxyEnvironment, readDu, readJobFile, readJobFileChecked, readRunnerIdentity, runnerLabelValue, spawnRun, trackImageBuild, withAnswerProtocol, writeJobFile };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILD_HOME } from './chunk-GMKDAF37.js';
3
+ import { BUILD_HOME } from './chunk-L2OARQKP.js';
4
4
  import { join, dirname } from 'path';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { toolsDockerfile } from './chunk-CMMEJJTL.js';
4
- import { runnerLabelValue } from './chunk-FLHBUQ2W.js';
5
- import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-X7M73LKT.js';
6
- import { CLAUDE_CODE_VERSION, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION, UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE } from './chunk-WX2HW2G2.js';
7
- import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-3FTIUB7I.js';
3
+ import { toolsDockerfile } from './chunk-KTVZ7TZY.js';
4
+ import { runnerLabelValue } from './chunk-AHWMY3MS.js';
5
+ import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-CM4J53WZ.js';
6
+ import { CLAUDE_CODE_VERSION, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION, UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE } from './chunk-D3CT6XQ4.js';
7
+ import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-3X6OSXSB.js';
8
8
  import { startTimeOf } from './chunk-JBJTC3UU.js';
9
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-3VJYDWFV.js';
10
- import { withGitConfig, tokenHeader } from './chunk-GMKDAF37.js';
9
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, runnerDir, rootfsPathFor } from './chunk-AJTGTSNA.js';
10
+ import { withGitConfig, tokenHeader } from './chunk-L2OARQKP.js';
11
11
  import { mkdirSync, rmSync, writeFileSync, existsSync, mkdtempSync, cpSync, readFileSync, readdirSync, lstatSync, readlinkSync } from 'fs';
12
12
  import { tmpdir } from 'os';
13
13
  import { dirname, join } from 'path';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-NO6E72RM.js';
4
- import { resolveGatewayCredentials } from './chunk-62URQYCB.js';
3
+ import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-4J5GRWAY.js';
4
+ import { resolveGatewayCredentials } from './chunk-PAGB3DCI.js';
5
5
  import { readCloudConfig } from './chunk-PJDQPF5N.js';
6
6
  import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
7
7
  import { resolveRepoIdentity } from './chunk-A6PJSNP6.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_DIGEST } from './chunk-WX2HW2G2.js';
3
+ import { UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_DIGEST } from './chunk-D3CT6XQ4.js';
4
4
  import { existsSync, readdirSync, readFileSync, lstatSync, realpathSync, writeFileSync } from 'fs';
5
5
  import { join, resolve, relative, dirname, sep, basename } from 'path';
6
6
  import { createRequire as createRequire$1 } from 'module';
@@ -29,18 +29,25 @@ var FIRECRACKER_SHA256 = {
29
29
  var FIRECRACKER_BINARY_SHA256 = {
30
30
  x86_64: "99ad0f5cd0514a88aad0e9ae8cfdb3cc3b4ab9d190e1194602406c786b5de7a5"
31
31
  };
32
- var GUEST_ASSETS_VERSION = "14";
32
+ var GUEST_ASSETS_VERSION = "16";
33
33
  var GUEST_ASSETS_BASE_URL = `https://github.com/outerlayerai/guest-assets/releases/download/guest-${GUEST_ASSETS_VERSION}`;
34
34
  var GUEST_KERNEL_SHA256 = {
35
35
  x86_64: "8552fad4bdea1d49f3e7d2aa500ce3f8918fcd2fc66779fd83235949688a39bb"
36
36
  };
37
37
  var GUEST_HELPER_SHA256 = {
38
- x86_64: "8080d4a8e8361cc8bf1cc34629bf49b6742e339c20cbf42d84a59b0d7fa33524"
38
+ x86_64: "c3c7f30a7238d274ea220632bb43a0e46589ee4194e9d7351774c17a2541cc12"
39
39
  };
40
40
  function guestAssetsPinned(arch) {
41
41
  const zero = "0".repeat(64);
42
42
  return GUEST_KERNEL_SHA256[arch] !== zero && GUEST_HELPER_SHA256[arch] !== zero;
43
43
  }
44
+ var NETWORK_HELPER_SHA256 = {
45
+ x86_64: "c3c7f30a7238d274ea220632bb43a0e46589ee4194e9d7351774c17a2541cc12",
46
+ aarch64: "02c10b2c2b7b233375e8f127ef3dd9fe43f9426a18f0d2cbb81b103911c62703"
47
+ };
48
+ function networkHelperPinned(arch, hashes = NETWORK_HELPER_SHA256) {
49
+ return Object.hasOwn(hashes, arch) && hashes[arch] !== "0".repeat(64);
50
+ }
44
51
  var JAILER_BINARY_SHA256 = {
45
52
  x86_64: "65ef226e96f0ceda55ba643f445801ef2cc0ea667ef67cad8ac4f406c9c8434f"
46
53
  };
@@ -135,4 +142,4 @@ function universalImagePinned(digest = UNIVERSAL_IMAGE_DIGEST) {
135
142
  return digest !== `sha256:${"0".repeat(64)}`;
136
143
  }
137
144
 
138
- export { BUILDER_DISK_BASE_URL, BUILDER_DISK_SHA256, BUILDER_DISK_VERSION, BUILDKIT_IMAGE, CLAUDE_CODE_VERSION, DEFAULT_BASE_IMAGE, FFMPEG_BUILD_TAG, FFMPEG_STATIC, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GH_SHA256, GH_VERSION, GUEST_ASSETS_BASE_URL, GUEST_ASSETS_VERSION, GUEST_HELPER_SHA256, GUEST_KERNEL_SHA256, HEADLESS_SHELL, HEADLESS_SHELL_BASE_URL, HEADLESS_SHELL_REVISION, HOST_HELPER_ASSETS_VERSION, HOST_HELPER_BASE_URL, HOST_HELPER_SHA256, HOST_HELPER_SLICE_SINCE, JAILER_BINARY_SHA256, MEDIA_PINS, MICROVM_ARCHES, NODE_IMAGE, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, PLAYWRIGHT_VERSION, TINI_SHA256, TINI_VERSION, UNIVERSAL_IMAGE, UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, VOICE_PACK_FILES, VOICE_PACK_VERSION, builderDiskPinned, firecrackerArch, guestAssetsPinned, hostHelperPinned, hostHelperSupportsSlice, universalImagePinned };
145
+ export { BUILDER_DISK_BASE_URL, BUILDER_DISK_SHA256, BUILDER_DISK_VERSION, BUILDKIT_IMAGE, CLAUDE_CODE_VERSION, DEFAULT_BASE_IMAGE, FFMPEG_BUILD_TAG, FFMPEG_STATIC, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, FIRECRACKER_VERSION, GH_SHA256, GH_VERSION, GUEST_ASSETS_BASE_URL, GUEST_ASSETS_VERSION, GUEST_HELPER_SHA256, GUEST_KERNEL_SHA256, HEADLESS_SHELL, HEADLESS_SHELL_BASE_URL, HEADLESS_SHELL_REVISION, HOST_HELPER_ASSETS_VERSION, HOST_HELPER_BASE_URL, HOST_HELPER_SHA256, HOST_HELPER_SLICE_SINCE, JAILER_BINARY_SHA256, MEDIA_PINS, MICROVM_ARCHES, NETWORK_HELPER_SHA256, NODE_IMAGE, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, PLAYWRIGHT_VERSION, TINI_SHA256, TINI_VERSION, UNIVERSAL_IMAGE, UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, VOICE_PACK_FILES, VOICE_PACK_VERSION, builderDiskPinned, firecrackerArch, guestAssetsPinned, hostHelperPinned, hostHelperSupportsSlice, networkHelperPinned, universalImagePinned };
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { resolveCredentials, postJson, getJson } from './chunk-6IMQXBTZ.js';
3
+ import { resolveCredentials, postJson, getJson } from './chunk-GJYGOFF3.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
5
  import { C } from './chunk-ANPNT6PM.js';
6
6
  import { sanitizeTerminal } from './chunk-IXPH4EXK.js';
7
- import { defaultFetch } from './chunk-62URQYCB.js';
7
+ import { defaultFetch } from './chunk-PAGB3DCI.js';
8
8
  import { resolveRepoIdentity } from './chunk-A6PJSNP6.js';
9
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
10
10
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-FLHBUQ2W.js';
4
- import { buildsDir, rootfsDir, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-3VJYDWFV.js';
3
+ import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-AHWMY3MS.js';
4
+ import { buildsDir, rootfsDir, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-AJTGTSNA.js';
5
5
  import { spawnSync } from 'child_process';
6
6
  import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
7
7
  import { dirname, join } from 'path';
@@ -2,7 +2,7 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { sanitizeTerminal } from './chunk-IXPH4EXK.js';
4
4
  import { isAgentsMdLayout } from './chunk-LYCJQOO2.js';
5
- import { resolveGatewayCredentials, defaultFetch } from './chunk-62URQYCB.js';
5
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-PAGB3DCI.js';
6
6
  import { versionAtLeast } from './chunk-HCVLP7XA.js';
7
7
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
8
8
  import { machineSkillsState, staleClaudeSkills } from './chunk-LASKTDCR.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-GMKDAF37.js';
3
+ import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-L2OARQKP.js';
4
4
  import { symlinkSync, unlinkSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -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-3VJYDWFV.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AJTGTSNA.js';
4
4
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-EYJRVHBN.js';
5
- import { workPageUrl } from './chunk-NO6E72RM.js';
4
+ import { autoConnect } from './chunk-BTDBDTUY.js';
5
+ import { workPageUrl } from './chunk-4J5GRWAY.js';
6
6
  import { C } from './chunk-ANPNT6PM.js';
7
7
  import { sanitizeTerminal } from './chunk-IXPH4EXK.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-62URQYCB.js';
9
- import { signRunnerRequest } from './chunk-RJZZFAXS.js';
8
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-PAGB3DCI.js';
9
+ import { signRunnerRequest } from './chunk-VKYU4HHW.js';
10
10
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
11
11
  import { resolveRepoIdentity } from './chunk-A6PJSNP6.js';
12
12
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
@@ -471,7 +471,7 @@ async function runWorkLinkSession(opts) {
471
471
  return await linkSession(opts);
472
472
  } catch (err) {
473
473
  if (opts.logFailures) {
474
- const { logHookError } = await import('./hook-fast-5WOGLR7V.js');
474
+ const { logHookError } = await import('./hook-fast-WM6YZVBJ.js');
475
475
  const reason = err instanceof Error ? err.message : String(err);
476
476
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
477
477
  }
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { scrubReason, stripTerminalControls } from './chunk-Y7MF32DM.js';
4
- import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-OHTMTMFX.js';
5
- import { RunnerAlreadyRunningError, readPidFile } from './chunk-3FTIUB7I.js';
3
+ import { scrubReason, stripTerminalControls } from './chunk-PBI4CM4M.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-NBETYM32.js';
5
+ import { RunnerAlreadyRunningError, readPidFile } from './chunk-3X6OSXSB.js';
6
6
  import { isSameProcess } from './chunk-JBJTC3UU.js';
7
- import { isSignatureRefusal, postJson } from './chunk-6IMQXBTZ.js';
8
- import { signerFor } from './chunk-RJZZFAXS.js';
9
- import { pidFilePath } from './chunk-3VJYDWFV.js';
7
+ import { isSignatureRefusal, postJson } from './chunk-GJYGOFF3.js';
8
+ import { signerFor } from './chunk-VKYU4HHW.js';
9
+ import { pidFilePath } from './chunk-AJTGTSNA.js';
10
10
  import { readFileSync } from 'fs';
11
11
 
12
12
  createRequire(import.meta.url);
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-LYX2RRSF.js';
4
- import { parseSize } from './chunk-FLHBUQ2W.js';
5
- import { builderDiskPinned } from './chunk-WX2HW2G2.js';
3
+ import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-EGJY6MBC.js';
4
+ import { parseSize } from './chunk-AHWMY3MS.js';
5
+ import { builderDiskPinned } from './chunk-D3CT6XQ4.js';
6
6
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
7
- import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-GMKDAF37.js';
7
+ import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-L2OARQKP.js';
8
8
  import { existsSync, statSync, accessSync, constants, readFileSync } from 'fs';
9
9
  import { hostname } from 'os';
10
10
  import { join } from 'path';