@outerlayer/cli 0.22.0 → 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 (109) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +4 -1
  3. package/dist/{agent-setup-XAJH6MPW.js → agent-setup-KXPDPTAJ.js} +6 -7
  4. package/dist/bridge-QFN3KJP6.js +8 -0
  5. package/dist/{build-GTMEADQD.js → build-6WRNZPVR.js} +4 -4
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-OAUSTZHL.js → builder-G3MLDMTI.js} +4 -4
  8. package/dist/{check-3YHMJQ3P.js → check-N6WLZCER.js} +34 -34
  9. package/dist/{chunk-4NM3I3VV.js → chunk-276D7BJ7.js} +1 -1
  10. package/dist/{chunk-22DYXLU7.js → chunk-2CPOAPU4.js} +17 -17
  11. package/dist/{chunk-BLW6GPBZ.js → chunk-2Q3PZ42G.js} +1 -1
  12. package/dist/{chunk-IRBNIRQJ.js → chunk-3AZYLAJC.js} +4 -4
  13. package/dist/{chunk-ATRIVTRE.js → chunk-4542B3RR.js} +2 -2
  14. package/dist/{chunk-7V7KG3YM.js → chunk-4AVDD7VX.js} +2 -2
  15. package/dist/{chunk-JVB63NIB.js → chunk-4OYKJJ2V.js} +1 -1
  16. package/dist/{chunk-QOALB6ZD.js → chunk-B42BIYC6.js} +2 -2
  17. package/dist/{chunk-G6DZCKA6.js → chunk-BVR6MQLS.js} +2 -3
  18. package/dist/{chunk-KPBQYEND.js → chunk-CQAEV3Z5.js} +1 -1
  19. package/dist/{chunk-IZSVXRDR.js → chunk-DXDF43YG.js} +1 -1
  20. package/dist/{chunk-F7CU5ABH.js → chunk-DYEFPYME.js} +1 -1
  21. package/dist/{chunk-LOB2SUM3.js → chunk-EFB3FGLC.js} +1 -1
  22. package/dist/{chunk-JRCSET55.js → chunk-EMUNEAQK.js} +3 -3
  23. package/dist/{chunk-2HT2XGJX.js → chunk-FQE5RDHI.js} +5 -6
  24. package/dist/{chunk-EXV37PKS.js → chunk-FVDVC2GF.js} +1 -1
  25. package/dist/{chunk-5QRP3MVS.js → chunk-GNPTU4BM.js} +9 -4
  26. package/dist/{chunk-6IO62VJS.js → chunk-HWZCE745.js} +2 -2
  27. package/dist/{chunk-KIGSGZBB.js → chunk-IHNQWF6F.js} +1 -1
  28. package/dist/{chunk-C3OVGKVJ.js → chunk-IMCVQF5F.js} +5 -5
  29. package/dist/{chunk-WMHYIBJW.js → chunk-IPS2JCHK.js} +6 -6
  30. package/dist/{chunk-G2WME4RG.js → chunk-JD6GWYY7.js} +2 -3
  31. package/dist/{chunk-C3HKR67W.js → chunk-JV4YGAAW.js} +3 -3
  32. package/dist/{chunk-FGW2774C.js → chunk-KOIMUHIS.js} +16 -15
  33. package/dist/{chunk-PHHBYAL6.js → chunk-NYTZ7HVN.js} +1 -1
  34. package/dist/{chunk-I66MQDXH.js → chunk-OBCFK4QD.js} +2 -2
  35. package/dist/{chunk-KDHYLBRR.js → chunk-OW52QLK3.js} +1 -1
  36. package/dist/chunk-QS43O4DR.js +113 -0
  37. package/dist/{chunk-4JHVPFH6.js → chunk-QZX6DAAW.js} +9 -10
  38. package/dist/{chunk-UD3EXMKB.js → chunk-SFHR45FA.js} +21 -4
  39. package/dist/{chunk-KOQELWQ6.js → chunk-SNVXHNU7.js} +2 -3
  40. package/dist/{chunk-34XORKFD.js → chunk-U6RKHNC7.js} +6 -7
  41. package/dist/{chunk-2J5JGLW5.js → chunk-UF5L4BAI.js} +1 -1
  42. package/dist/{chunk-V7MQKOZY.js → chunk-URWYRAIC.js} +1 -1
  43. package/dist/{chunk-2CMJLYV6.js → chunk-V5CG75NX.js} +1 -1
  44. package/dist/{chunk-VX74ND77.js → chunk-WKSBSEWT.js} +8 -8
  45. package/dist/chunk-WXJXHZVB.js +73 -0
  46. package/dist/{chunk-ZFLOGMUC.js → chunk-XACXXKQ5.js} +1 -1
  47. package/dist/{chunk-WERZMIKA.js → chunk-XR56WEA5.js} +3 -3
  48. package/dist/{chunk-4QKLMNI3.js → chunk-ZCXP35T3.js} +5 -5
  49. package/dist/{claude-launcher-4BQNXYAF.js → claude-launcher-QD3C427Y.js} +1 -1
  50. package/dist/{cli-NMGVZQPB.js → cli-A2Y67WAB.js} +98 -91
  51. package/dist/{command-GE62AJZY.js → command-Q5Q2EIO4.js} +21 -22
  52. package/dist/{config-7Q52COZ3.js → config-H4QS332G.js} +2 -2
  53. package/dist/{connect-cmd-ZFOK6HEL.js → connect-cmd-TNGEIWCA.js} +7 -2
  54. package/dist/{control-plane-launch-SZTE4TUS.js → control-plane-launch-HE6OSWKO.js} +5 -6
  55. package/dist/{docker-2OVBKVRK.js → docker-JU422JL7.js} +4 -4
  56. package/dist/{doctor-3SQGZVYP.js → doctor-BRN4BGMA.js} +23 -24
  57. package/dist/{emit-artifact-cmd-R42BE6ID.js → emit-artifact-cmd-GPAJCCUC.js} +12 -12
  58. package/dist/{emit-criteria-cmd-MQZE7W4Y.js → emit-criteria-cmd-R3FKHSQG.js} +7 -7
  59. package/dist/{emit-finding-cmd-ZS5JEGGM.js → emit-finding-cmd-IK7RAVP5.js} +7 -7
  60. package/dist/{emit-result-cmd-FUE3DXBW.js → emit-result-cmd-5FJTF7YD.js} +12 -12
  61. package/dist/{emit-step-cmd-T7PRA44X.js → emit-step-cmd-VRTD5YPP.js} +8 -8
  62. package/dist/{exec-client-YIDTWXMZ.js → exec-client-ATPF2DDB.js} +3 -3
  63. package/dist/{governing-source-TORXL4I4.js → governing-source-WM736XR4.js} +9 -10
  64. package/dist/{guest-init-TO6HAWIT.js → guest-init-2OZ4YC7R.js} +4 -3
  65. package/dist/{hook-fast-WFB2ZMRB.js → hook-fast-QUGEI2IT.js} +1 -1
  66. package/dist/{hook-wrap-fast-NPLHJXFK.js → hook-wrap-fast-NOOGDNSW.js} +2 -2
  67. package/dist/{host-key-2LXQDSBO.js → host-key-ATB23GI3.js} +3 -3
  68. package/dist/index.js +6 -6
  69. package/dist/{init-2CRAVIUU.js → init-U3I43XCP.js} +20 -21
  70. package/dist/{init-AHDZCMDC.js → init-X7FCQDFX.js} +20 -21
  71. package/dist/{init-cmd-IXDL2ZSL.js → init-cmd-VCKH2DUQ.js} +13 -14
  72. package/dist/{init-update-YB3PODDH.js → init-update-TCMH7M3Q.js} +7 -8
  73. package/dist/{install-CZUIW2AF.js → install-SFACZU7E.js} +4 -4
  74. package/dist/{install-cmd-Q7RJGFUO.js → install-cmd-6HTP7I43.js} +5 -5
  75. package/dist/{logs-RJPYTVQE.js → logs-N3ZX7HFV.js} +2 -2
  76. package/dist/{loop-ZDW6TRAA.js → loop-P3QDQOE5.js} +34 -34
  77. package/dist/{machine-JCOHLASP.js → machine-EEFOW32K.js} +16 -17
  78. package/dist/{mcp-serve-cmd-IULQPVHL.js → mcp-serve-cmd-TQSPFRC7.js} +5 -5
  79. package/dist/{paths-N3LU4O2Z.js → paths-AKX2OOLF.js} +2 -2
  80. package/dist/{pending-GRCV3ZR4.js → pending-7SGWZCEH.js} +3 -3
  81. package/dist/{pidfile-IF3TCL5A.js → pidfile-G2J5WBQS.js} +3 -3
  82. package/dist/{record-73PQE77B.js → record-Q4IEYIVV.js} +3 -3
  83. package/dist/{runner-env-LDOBJESN.js → runner-env-GZHXM27A.js} +5 -5
  84. package/dist/{runner-identity-RWCBTY2A.js → runner-identity-FTHZFMGY.js} +4 -4
  85. package/dist/{runner-key-HMYLP6WN.js → runner-key-O42EUXQU.js} +20 -21
  86. package/dist/{session-sender-2G25JYHI.js → session-sender-HF6DXFA2.js} +13 -13
  87. package/dist/{settings-J2652U5N.js → settings-AKYEOCC2.js} +1 -1
  88. package/dist/{spec-cmd-LBVXM6XS.js → spec-cmd-ADPH236D.js} +8 -8
  89. package/dist/{status-QZB2GWXJ.js → status-LXFIVGP3.js} +25 -25
  90. package/dist/{statusline-fast-2OK3DVAA.js → statusline-fast-GVRSBHAF.js} +2 -2
  91. package/dist/{sync-cmd-TQQIR4PN.js → sync-cmd-5XS3CUV5.js} +12 -12
  92. package/dist/{watch-4JES4PCS.js → watch-FBZHZV56.js} +12 -12
  93. package/dist/{work-claim-cmd-XG6O7B63.js → work-claim-cmd-LIIINECF.js} +11 -11
  94. package/dist/{work-cmd-L6WMPAA2.js → work-cmd-SM6DY2WK.js} +8 -8
  95. package/dist/{work-comment-cmd-SNTDCPGH.js → work-comment-cmd-VYVXGT4W.js} +8 -8
  96. package/dist/{work-logs-cmd-3S7IAVII.js → work-logs-cmd-XZSCWWMW.js} +8 -8
  97. package/dist/{work-open-pr-cmd-E3WMO5XT.js → work-open-pr-cmd-YZNC3P3R.js} +9 -9
  98. package/dist/{work-pr-cmd-22T6FG4T.js → work-pr-cmd-AMN23KFJ.js} +8 -8
  99. package/dist/{work-stop-cmd-WR7ESS4Z.js → work-stop-cmd-HSR2GOJJ.js} +8 -8
  100. package/package.json +1 -1
  101. package/skill-pack/maintained/outerlayer-amend/SKILL.md +90 -78
  102. package/skill-pack/maintained/outerlayer-build/SKILL.md +4 -2
  103. package/skill-pack/maintained/outerlayer-build/references/agent-briefs.md +10 -3
  104. package/skill-pack/maintained/outerlayer-build/references/release.md +7 -4
  105. package/skill-pack/maintained/outerlayer-build/references/review-briefs.md +6 -3
  106. package/skill-pack/maintained/outerlayer-cli/SKILL.md +8 -1
  107. package/skill-pack/maintained/outerlayer-cli/references/merge-base-branch.md +54 -0
  108. package/dist/chunk-NTRCK4NH.js +0 -38
  109. package/dist/chunk-VWLOQ6FI.js +0 -56
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
- import { autoConnect, detectActiveSession } from './chunk-QOALB6ZD.js';
4
+ import { autoConnect, detectActiveSession } from './chunk-B42BIYC6.js';
5
5
  import { acquireSpoolLockAt } from './chunk-G3IJ3N6F.js';
6
- import { defaultFetch } from './chunk-VWLOQ6FI.js';
7
- import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
6
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-QS43O4DR.js';
8
7
  import { resolveRepoIdentity } from './chunk-AEKSX4EY.js';
9
8
  import { C } from './chunk-ANPNT6PM.js';
10
9
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { compareVersions } from './chunk-I2UOAV7X.js';
4
- import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-LOB2SUM3.js';
5
- import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-4NM3I3VV.js';
6
- import { RUNNER_DIR_MODE } from './chunk-KIGSGZBB.js';
4
+ import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-EFB3FGLC.js';
5
+ import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-276D7BJ7.js';
6
+ import { RUNNER_DIR_MODE } from './chunk-IHNQWF6F.js';
7
7
  import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
8
8
  import { dirname, sep, join } from 'path';
9
9
 
@@ -1,18 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { senderPidfile } from './chunk-ATRIVTRE.js';
4
- import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-UD3EXMKB.js';
5
- import { installScrubContext } from './chunk-34XORKFD.js';
6
- import { ADDED_USER, AssetError, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createBuildDisk, machineConfig, resolveAgentUser, AgentUserError, runBuildSteps, shellQuote, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, containerSenderCommand, signalInContainer, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, GH_CONFIG_YML, ghHostsYml, isLiteralAddress, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, copyJudgeTree } from './chunk-VX74ND77.js';
7
- import { readBranchHead, fetchCommit, diffBetween } from './chunk-IRBNIRQJ.js';
8
- import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, COMMAND_DIR, childEnvironment, judgeCommand, JUDGE_MAX_TURNS, MAX_REPORT_BYTES, JUDGE_DIR } from './chunk-WERZMIKA.js';
3
+ import { senderPidfile } from './chunk-4542B3RR.js';
4
+ import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-SFHR45FA.js';
5
+ import { writeDockerClientConfig } from './chunk-WXJXHZVB.js';
6
+ import { installScrubContext } from './chunk-U6RKHNC7.js';
7
+ import { ADDED_USER, AssetError, obtainImage, ensureRootfs, gitRemoteFor, startServicesFor, createBuildDisk, machineConfig, resolveAgentUser, AgentUserError, runBuildSteps, shellQuote, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, containerSenderCommand, signalInContainer, syncInContainer, copyTranscriptsFromContainer, senderAliveScript, GH_CONFIG_YML, ghHostsYml, isLiteralAddress, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, copyJudgeTree } from './chunk-WKSBSEWT.js';
8
+ import { readBranchHead, fetchCommit, diffBetween } from './chunk-3AZYLAJC.js';
9
+ import { HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, COMMAND_DIR, childEnvironment, judgeCommand, JUDGE_MAX_TURNS, MAX_REPORT_BYTES, JUDGE_DIR } from './chunk-XR56WEA5.js';
9
10
  import { CLAUDE_CODE_VERSION } from './chunk-3W333NFO.js';
10
- import { waitForAgent, vmExecArgs } from './chunk-PHHBYAL6.js';
11
- import { socketPathProblem, vsockLinks, linkVsockSockets } from './chunk-BLW6GPBZ.js';
12
- import { describeCallFailure, resolveGoverningSource, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, retrySend, formatClock } from './chunk-C3OVGKVJ.js';
13
- import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-2HT2XGJX.js';
11
+ import { waitForAgent, vmExecArgs } from './chunk-NYTZ7HVN.js';
12
+ import { socketPathProblem, vsockLinks, linkVsockSockets } from './chunk-2Q3PZ42G.js';
13
+ import { describeCallFailure, resolveGoverningSource, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, formatDuration, retrySend, formatClock } from './chunk-IMCVQF5F.js';
14
+ import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-FQE5RDHI.js';
14
15
  import { planArtifactUpload } from './chunk-G3IJ3N6F.js';
15
- import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-2CMJLYV6.js';
16
+ import { isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-V5CG75NX.js';
16
17
  import { parseSize } from './chunk-7RQ73DLO.js';
17
18
  import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
18
19
  import { scrubText } from './chunk-AEKSX4EY.js';
@@ -21,9 +22,9 @@ import { resolvePackRoot } from './chunk-5OCIHFGE.js';
21
22
  import { parsePolicy } from './chunk-WFSUUUAN.js';
22
23
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
23
24
  import { resolveVersion } from './chunk-RA3O54FC.js';
24
- import { signerFor } from './chunk-KDHYLBRR.js';
25
- import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath } from './chunk-KIGSGZBB.js';
26
- import { claudeCredential, repositoriesOf, primaryOf, buildEnvironment, JOB_MOUNT, CHECKOUT_DIR, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, checkEnvironment, EVAL_INPUT_DIR } from './chunk-V7MQKOZY.js';
25
+ import { signerFor } from './chunk-OW52QLK3.js';
26
+ import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath } from './chunk-IHNQWF6F.js';
27
+ import { claudeCredential, repositoriesOf, primaryOf, buildEnvironment, JOB_MOUNT, CHECKOUT_DIR, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, RELAY_PORT, repositoryPath, lifecycleWorkdir, checkEnvironment, EVAL_INPUT_DIR } from './chunk-URWYRAIC.js';
27
28
  import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON } from './chunk-GISNHSYL.js';
28
29
  import { existsSync, statSync, appendFileSync, mkdirSync, chmodSync, writeFileSync, accessSync, constants, openSync, readFileSync, closeSync, rmSync, readdirSync, lstatSync, fstatSync, readSync, realpathSync } from 'fs';
29
30
  import { join, isAbsolute, dirname, delimiter, sep } from 'path';
@@ -413,7 +414,7 @@ async function waitForDocker(runtime, state, agentUser, now) {
413
414
  if (firstLine(granted.stderr) !== "") lastError = `giving the agent's group the Docker socket failed: ${firstLine(granted.stderr)}`;
414
415
  } else {
415
416
  const answered = await runtime.vm.exec(state.vsockPath, request);
416
- if (answered.status === 0) return void 0;
417
+ if (answered.status === 0) return writeDockerClientConfig(asRoot.bind(null, runtime, state), agentUser);
417
418
  lastError = firstLine(answered.stderr) === "" ? "" : `docker info said: ${firstLine(answered.stderr)}`;
418
419
  }
419
420
  if (now().getTime() >= deadline) break;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { EXEC_PORT } from './chunk-BLW6GPBZ.js';
3
+ import { EXEC_PORT } from './chunk-2Q3PZ42G.js';
4
4
  import { createConnection } from 'net';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { builtinKind } from './chunk-2CMJLYV6.js';
3
+ import { builtinKind } from './chunk-V5CG75NX.js';
4
4
  import { parseSize } from './chunk-7RQ73DLO.js';
5
- import { runnerDir } from './chunk-KIGSGZBB.js';
5
+ import { runnerDir } from './chunk-IHNQWF6F.js';
6
6
  import { dirname } from 'path';
7
7
  import { spawnSync } from 'child_process';
8
8
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KIGSGZBB.js';
3
+ import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
4
4
  import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
5
5
  import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
6
6
 
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
4
+ import { readCloudConfig, cloudConfigPath } from './chunk-EABW6AJQ.js';
5
+ import { cliInvocation } from './chunk-CRB3POP4.js';
6
+ import { homeFromEnv } from './chunk-VNVZDWO3.js';
7
+ import { resolvePackageVersion } from './chunk-RA3O54FC.js';
8
+ import { signRunnerRequest, signerFor } from './chunk-OW52QLK3.js';
9
+
10
+ createRequire(import.meta.url);
11
+
12
+ // src/credentials.ts
13
+ var MISSING_HELP = `Run \`${cliInvocation()} login\` to sign in, or set OUTERLAYER_URL / OUTERLAYER_API_KEY / OUTERLAYER_APP_ID. Mint a key in the dashboard: Settings \u2192 API keys.`;
14
+ var NO_FACTORY_MESSAGE = `you are logged in, but no factory is chosen for this repository. Run \`${cliInvocation()} connect\` to choose one, or pass --app-id / set OUTERLAYER_APP_ID.`;
15
+ var NO_FACTORY_OUTSIDE_REPOSITORY_MESSAGE = "you are logged in, but this directory is not in a git repository, so no factory is chosen. Pass --app-id / set OUTERLAYER_APP_ID, or run this from inside a connected repository.";
16
+ var LOGIN_TOKEN_PREFIX = "olu_";
17
+ function unauthorizedMessage(credential) {
18
+ return credential.startsWith(LOGIN_TOKEN_PREFIX) ? `not authorized \u2014 the login is expired or was revoked. Run \`${cliInvocation()} login\` to sign in again.` : "not authorized \u2014 the API key is unknown, expired, or bound to a different factory. Mint a fresh key: dashboard \u2192 Settings \u2192 API keys.";
19
+ }
20
+ function resolveGatewayCredentials(sources = {}) {
21
+ const env = sources.env ?? process.env;
22
+ const config = readCloudConfig(sources.home ?? homeFromEnv(env));
23
+ const url = sources.url ?? env.OUTERLAYER_URL ?? config.url;
24
+ const key = sources.apiKey ?? (env.OUTERLAYER_API_KEY || void 0) ?? config.apiKey;
25
+ const kind = key ? "key" : "login";
26
+ const credential = key ?? config.accountToken;
27
+ const cwd = sources.cwd ?? process.cwd();
28
+ const appId = sources.appId ?? (env.OUTERLAYER_APP_ID || void 0) ?? (kind === "key" ? config.appId : readRepoConnection(cwd)?.appId);
29
+ if (credential && url && !appId && kind === "login") {
30
+ const message = findGitDirs(cwd) === void 0 ? NO_FACTORY_OUTSIDE_REPOSITORY_MESSAGE : NO_FACTORY_MESSAGE;
31
+ return { ok: false, message, url, credential, appId, kind };
32
+ }
33
+ if (!url || !credential || !appId) {
34
+ const missing = [!url && "--url", !credential && "a login or OUTERLAYER_API_KEY", !appId && "--app-id"].filter(Boolean).join(", ");
35
+ return { ok: false, message: `missing ${missing}. ${MISSING_HELP}`, url, credential, appId, kind };
36
+ }
37
+ return { ok: true, url, credential, appId, kind };
38
+ }
39
+
40
+ // src/signing-fetch.ts
41
+ function bodyBytes(body) {
42
+ if (body === void 0 || body === null) return new Uint8Array(0);
43
+ if (typeof body === "string") return new TextEncoder().encode(body);
44
+ if (body instanceof Uint8Array) return body;
45
+ if (body instanceof ArrayBuffer) return new Uint8Array(body);
46
+ return void 0;
47
+ }
48
+ async function savedKeySigner(headers, home) {
49
+ const authorization = headers.get("authorization");
50
+ if (authorization === null || !authorization.startsWith("Bearer ")) return void 0;
51
+ if (headers.has("signature")) return void 0;
52
+ if (readCloudConfig(home).apiKey !== authorization.slice("Bearer ".length)) return void 0;
53
+ try {
54
+ return await signerFor(cloudConfigPath(home));
55
+ } catch {
56
+ return void 0;
57
+ }
58
+ }
59
+ function signedBy(base, signerOf) {
60
+ return (async (input, init) => {
61
+ if (input instanceof Request) return base(input, init);
62
+ const headers = new Headers(init?.headers);
63
+ const signer = await signerOf(headers);
64
+ const body = bodyBytes(init?.body);
65
+ if (signer === void 0 || body === void 0) return base(input, init);
66
+ const signature = await signRunnerRequest({ method: init?.method ?? "GET", url: input.toString(), body, signer });
67
+ for (const [name, value] of Object.entries(signature)) headers.set(name, value);
68
+ return base(input, { ...init, headers });
69
+ });
70
+ }
71
+ function signingFetch(base, home = () => homeFromEnv()) {
72
+ return signedBy(base, (headers) => savedKeySigner(headers, home()));
73
+ }
74
+ function signingFetchFor(base, configPath, apiKey) {
75
+ return signedBy(base, async (headers) => {
76
+ const authorization = headers.get("authorization");
77
+ if (authorization !== `Bearer ${apiKey}` || headers.has("signature")) return void 0;
78
+ try {
79
+ return await signerFor(configPath);
80
+ } catch {
81
+ return void 0;
82
+ }
83
+ });
84
+ }
85
+ function cliUserAgent(version = resolvePackageVersion()) {
86
+ return `outerlayer-cli/${version}`;
87
+ }
88
+ function withHeader(headers, name, value) {
89
+ if (headers instanceof Headers) {
90
+ if (headers.has(name)) return headers;
91
+ const copy = new Headers(headers);
92
+ copy.set(name, value);
93
+ return copy;
94
+ }
95
+ if (Array.isArray(headers)) {
96
+ return headers.some(([key]) => key.toLowerCase() === name) ? headers : [...headers, [name, value]];
97
+ }
98
+ const record = headers ?? {};
99
+ return Object.keys(record).some((key) => key.toLowerCase() === name) ? record : { ...record, [name]: value };
100
+ }
101
+ function withCliUserAgent(base, userAgent = () => cliUserAgent()) {
102
+ return ((input, init) => {
103
+ if (input instanceof Request) return base(input, init);
104
+ return base(input, { ...init, headers: withHeader(init?.headers, "user-agent", userAgent()) });
105
+ });
106
+ }
107
+ function globalFetch(input, init) {
108
+ return globalThis.fetch(input, init);
109
+ }
110
+ var cliFetch = withCliUserAgent(globalFetch);
111
+ var defaultFetch = signingFetch(cliFetch);
112
+
113
+ export { cliFetch, defaultFetch, resolveGatewayCredentials, signingFetchFor, unauthorizedMessage };
@@ -1,20 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { checkStarterFiles, contextIsGoverned, checkBuildSkill } from './chunk-VSUXCMMH.js';
4
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-2HT2XGJX.js';
5
- import { isLinkedRepository } from './chunk-JRCSET55.js';
4
+ import { resolveCredentials, getJson, WorkCommandError } from './chunk-FQE5RDHI.js';
5
+ import { isLinkedRepository } from './chunk-EMUNEAQK.js';
6
6
  import { sanitizeTerminal } from './chunk-G3IJ3N6F.js';
7
7
  import { checkFormerSkillNames } from './chunk-USWVXQIH.js';
8
- import { defaultFetch } from './chunk-VWLOQ6FI.js';
9
- import { resolveGatewayCredentials } from './chunk-NTRCK4NH.js';
10
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-6IO62VJS.js';
11
- import { readStatuslineState, STATE_FRESH_MS } from './chunk-IZSVXRDR.js';
8
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-QS43O4DR.js';
9
+ import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-HWZCE745.js';
10
+ import { readStatuslineState, STATE_FRESH_MS } from './chunk-DXDF43YG.js';
12
11
  import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
13
12
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
14
13
  import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-AEKSX4EY.js';
15
14
  import { C } from './chunk-ANPNT6PM.js';
16
15
  import { cliInvocation } from './chunk-CRB3POP4.js';
17
- import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-5QRP3MVS.js';
16
+ import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-GNPTU4BM.js';
18
17
  import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
19
18
  import { deadHooksState, preparePackageManagerCommand } from './chunk-TUSYOL2O.js';
20
19
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -1175,7 +1174,7 @@ function doctorExitCode(checks) {
1175
1174
 
1176
1175
  // src/doctor-report.ts
1177
1176
  async function gatherDoctorChecks() {
1178
- const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-7Q52COZ3.js');
1177
+ const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-H4QS332G.js');
1179
1178
  const configPath = defaultRunnerConfigPath();
1180
1179
  const checks = runDoctor({ runnerHost: hasRunnerBlock(configPath) });
1181
1180
  const credential = await credentialChecks();
@@ -1187,7 +1186,7 @@ async function gatherDoctorChecks() {
1187
1186
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1188
1187
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1189
1188
  } else if (hasRunnerBlock(configPath)) {
1190
- const { runnerHostChecks } = await import('./doctor-3SQGZVYP.js');
1189
+ const { runnerHostChecks } = await import('./doctor-BRN4BGMA.js');
1191
1190
  const hooks = (() => {
1192
1191
  try {
1193
1192
  return loadRunnerConfig(configPath).hooks;
@@ -1222,7 +1221,7 @@ async function gatherDoctorChecks() {
1222
1221
  const { existsSync: existsSync3 } = await import('fs');
1223
1222
  if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
1224
1223
  const { inspectService, realInspectProbes } = await import('./inspect-6UYAAXH7.js');
1225
- const { DEFAULT_UNIT_NAME } = await import('./install-CZUIW2AF.js');
1224
+ const { DEFAULT_UNIT_NAME } = await import('./install-SFACZU7E.js');
1226
1225
  const { dirname: dirname2 } = await import('path');
1227
1226
  return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
1228
1227
  })();
@@ -1,8 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { EXEC_PORT } from './chunk-BLW6GPBZ.js';
3
+ import { BRIDGE_ADDRESS, TUNNEL_PORT, BRIDGE_CIDR } from './chunk-WXJXHZVB.js';
4
+ import { EXEC_PORT } from './chunk-2Q3PZ42G.js';
4
5
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
- import { RELAY_PORT } from './chunk-V7MQKOZY.js';
6
+ import { RELAY_PORT } from './chunk-URWYRAIC.js';
6
7
  import { spawn, spawnSync } from 'child_process';
7
8
  import { writeFileSync, chmodSync, mkdirSync } from 'fs';
8
9
 
@@ -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,15 +1,14 @@
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-VWLOQ6FI.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';
9
8
  import { writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, writeContextManifest, SOURCE_CACHE_TTL_SUCCESS_MS, readSourceCache, isSourceCacheFresh, clearDegraded } from './chunk-YQR6E6OV.js';
10
9
  import { normalizeRepoName, parseOuterlayerConfig, classifyTree, emitTree } from './chunk-WFSUUUAN.js';
11
10
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
12
- import { withTokenHeader } from './chunk-V7MQKOZY.js';
11
+ import { withTokenHeader } from './chunk-URWYRAIC.js';
13
12
  import { execFileSync } from 'child_process';
14
13
  import { existsSync, mkdirSync, writeFileSync, chmodSync, lstatSync, readFileSync, copyFileSync } from 'fs';
15
14
  import { isAbsolute, join, dirname } from 'path';
@@ -1,14 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { uploadSpooledSteps } from './chunk-G2WME4RG.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-VWLOQ6FI.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage } from './chunk-NTRCK4NH.js';
9
- import { writeSyncStatus, spoolDir } from './chunk-6IO62VJS.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';
@@ -19,7 +18,7 @@ import { cliInvocation } from './chunk-CRB3POP4.js';
19
18
  import { removeJournalHooks } from './chunk-TUSYOL2O.js';
20
19
  import { CAPTURE_TIERS, inferArtifactKind, bannedPathsForTier, downconvertSession, isHumanUserTurn, turnCountBound, EVENT_TYPES } from './chunk-7VUK5RFS.js';
21
20
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
22
- import { signerFor, signRunnerRequest } from './chunk-KDHYLBRR.js';
21
+ import { signerFor, signRunnerRequest } from './chunk-OW52QLK3.js';
23
22
  import { dirname, basename, join } from 'path';
24
23
  import { statSync, readFileSync, readdirSync, mkdirSync, writeFileSync, renameSync, existsSync, rmSync } from 'fs';
25
24
  import { execFileSync } from 'child_process';
@@ -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;
@@ -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-KIGSGZBB.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
4
4
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -645,4 +645,4 @@ function withTunnelRecord(environment, record, onlyWhenUsed = false) {
645
645
  };
646
646
  }
647
647
 
648
- export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILT_IN_NAMES, CHECKOUT_DIR, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT, RELAY_PORT, authorEnvironment, buildEnvironment, builtInEnvironment, checkEnvironment, checkoutPath, claudeCredential, commitIdentityRecord, containerLocalAddress, destinationEnvironment, headerVariables, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseUnreachable, primaryOf, proxyEnvironment, repositoriesOf, repositoryPath, resolveDestinations, sharedUserEnvironment, startBuildServices, tokenHeader, withGitConfig, withHooksPath, withProxyWarningHidden, withTokenHeader, withTunnelRecord };
648
+ export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILT_IN_NAMES, CHECKOUT_DIR, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT, PROXY_WARNING_FLAG, RELAY_PORT, authorEnvironment, buildEnvironment, builtInEnvironment, checkEnvironment, checkoutPath, claudeCredential, commitIdentityRecord, containerLocalAddress, destinationEnvironment, headerVariables, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseUnreachable, primaryOf, proxyEnvironment, repositoriesOf, repositoryPath, resolveDestinations, sharedUserEnvironment, startBuildServices, tokenHeader, withGitConfig, withHooksPath, withProxyWarningHidden, withTokenHeader, withTunnelRecord };
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
3
3
  import { MAX_ALLOW_HOSTS, allowHostProblem } from './chunk-UXYLWVTQ.js';
4
4
  import { parseSize } from './chunk-7RQ73DLO.js';
5
5
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
6
- import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-V7MQKOZY.js';
6
+ import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-URWYRAIC.js';
7
7
  import { existsSync, statSync, accessSync, constants, readFileSync } from 'fs';
8
8
  import { hostname } from 'os';
9
9
  import { join } from 'path';
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-IRBNIRQJ.js';
3
+ import { readDefaultBranchHead, cloneRepository, buildRepositoryImage } from './chunk-3AZYLAJC.js';
4
4
  import { currentCliBuild } from './chunk-OGFGZQA3.js';
5
- import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-WERZMIKA.js';
5
+ import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, JUDGE_DIR, JUDGE_REPORT, MAX_REPORT_BYTES, spawnRun } from './chunk-XR56WEA5.js';
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
- import { execCapture } from './chunk-PHHBYAL6.js';
8
- import { GUEST_CID } from './chunk-BLW6GPBZ.js';
9
- import { describeCallFailure, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript } from './chunk-C3OVGKVJ.js';
10
- import { WorkCommandError } from './chunk-2HT2XGJX.js';
7
+ import { execCapture } from './chunk-NYTZ7HVN.js';
8
+ import { GUEST_CID } from './chunk-2Q3PZ42G.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';
@@ -16,8 +16,8 @@ import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
16
16
  import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-AEKSX4EY.js';
17
17
  import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-WFSUUUAN.js';
18
18
  import { downconvertSession } from './chunk-7VUK5RFS.js';
19
- import { rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, RUNNER_DIR_MODE, SHIM_DIR, vmAssetsDir } from './chunk-KIGSGZBB.js';
20
- import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-V7MQKOZY.js';
19
+ import { rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, buildDir, RUNNER_DIR_MODE, SHIM_DIR, vmAssetsDir } from './chunk-IHNQWF6F.js';
20
+ import { repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, claudeCredential, buildEnvironment, startBuildServices, checkEnvironment, AGENT_CREDENTIAL_MISSING, checkoutPath, JOB_MOUNT } from './chunk-URWYRAIC.js';
21
21
  import { RELAY_USER, RELAY_ID, UNKNOWN_TRANSPORT_REASON, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, MAX_OPEN_STREAMS, STREAM_WINDOW, SESSION_WINDOW, targetOfPath } from './chunk-GISNHSYL.js';
22
22
  import { readFileSync, existsSync, mkdirSync, chmodSync, truncateSync, rmSync, writeFileSync, readdirSync, lstatSync, copyFileSync, accessSync, constants, statSync, rmdirSync, renameSync, unlinkSync, openSync, closeSync, mkdtempSync, createWriteStream, createReadStream } from 'fs';
23
23
  import { join, dirname, basename } from 'path';
@@ -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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { isSameProcess } from './chunk-JBJTC3UU.js';
4
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KIGSGZBB.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
5
5
  import { existsSync, readFileSync, rmSync, mkdirSync, writeFileSync } from 'fs';
6
6
  import { dirname } from 'path';
7
7
 
@@ -3,9 +3,9 @@ import { createRequire } from 'node:module';
3
3
  import { RecipeError, BUILDKIT_IMAGE } from './chunk-3W333NFO.js';
4
4
  import { parseSize } from './chunk-7RQ73DLO.js';
5
5
  import { compareVersions } from './chunk-AEKSX4EY.js';
6
- import { ensureHostKey } from './chunk-KDHYLBRR.js';
7
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-KIGSGZBB.js';
8
- import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-V7MQKOZY.js';
6
+ import { ensureHostKey } from './chunk-OW52QLK3.js';
7
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-IHNQWF6F.js';
8
+ import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-URWYRAIC.js';
9
9
  import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-GISNHSYL.js';
10
10
  import { StringDecoder } from 'string_decoder';
11
11
  import { spawn } from 'child_process';
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-7V7KG3YM.js';
4
- import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-EXV37PKS.js';
5
- import { MIN_ENGINE_MAJOR } from './chunk-VX74ND77.js';
6
- import { runnerCredentialProblem } from './chunk-2CMJLYV6.js';
7
- import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-KIGSGZBB.js';
3
+ import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-4AVDD7VX.js';
4
+ import { detectMachine, supportsContainerBuilds, reachDockerStep, describeMachineDocker, supportsMicroVmBuilds } from './chunk-FVDVC2GF.js';
5
+ import { MIN_ENGINE_MAJOR } from './chunk-WKSBSEWT.js';
6
+ import { runnerCredentialProblem } from './chunk-V5CG75NX.js';
7
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-IHNQWF6F.js';
8
8
  import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
9
9
  import { dirname } from 'path';
10
10
 
@@ -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-SZTE4TUS.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);