@outerlayer/cli 0.34.0-next.20261025132734 → 0.34.0-next.20261025180645

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 (130) hide show
  1. package/README.md +6 -0
  2. package/dist/{agent-setup-HEJM3D3V.js → agent-setup-FNDKCPUP.js} +8 -9
  3. package/dist/{bridge-NBCXFTT4.js → bridge-YJBB4YA3.js} +2 -3
  4. package/dist/build-B4OKU4MV.js +16 -0
  5. package/dist/{build-disk-LEZ6LAM3.js → build-disk-ZL46AEN3.js} +7 -9
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-I32JOQII.js → builder-XFPWE74N.js} +6 -8
  8. package/dist/{check-OOUGS65D.js → check-QULEN437.js} +45 -45
  9. package/dist/{chunk-65AKMFBH.js → chunk-25GRRBTH.js} +1 -1
  10. package/dist/{chunk-3CKMB2UK.js → chunk-2D6CKNR7.js} +8 -4
  11. package/dist/{chunk-5THSC6BD.js → chunk-2ILU7UAU.js} +1 -1
  12. package/dist/{chunk-5QBUX5YZ.js → chunk-3EJBI5JW.js} +3 -3
  13. package/dist/{chunk-6RKD7YZ6.js → chunk-3N77LUQI.js} +1 -1
  14. package/dist/{chunk-ES4ULBAL.js → chunk-4UPET3R7.js} +7 -3
  15. package/dist/{chunk-43I7PXDP.js → chunk-5AFPP3GZ.js} +239 -15
  16. package/dist/{chunk-HVRQQOMH.js → chunk-63IVRRIO.js} +3 -3
  17. package/dist/{chunk-FVKH3PMV.js → chunk-6OLVVAOK.js} +5 -5
  18. package/dist/{chunk-6ZFY2L2T.js → chunk-AJYZNISW.js} +416 -20
  19. package/dist/{chunk-6NUPXDAA.js → chunk-AVPLEFQR.js} +3 -3
  20. package/dist/{chunk-EN3YWO7Q.js → chunk-BHSSGVOY.js} +4 -4
  21. package/dist/{chunk-O6DYCIVW.js → chunk-CAQCDYKF.js} +2 -2
  22. package/dist/{chunk-7WM7K2DY.js → chunk-DNZYXEMY.js} +35 -21
  23. package/dist/{chunk-QMWUPRYQ.js → chunk-EGVHFHY4.js} +4 -4
  24. package/dist/{chunk-ACRRO3MB.js → chunk-FD5ASWTG.js} +22 -22
  25. package/dist/{chunk-57L2YAJA.js → chunk-FDJPDZSR.js} +1 -1
  26. package/dist/{chunk-EE2ZZGQV.js → chunk-FVCHHSHB.js} +3 -3
  27. package/dist/{chunk-BALIE3BA.js → chunk-G4W4B33M.js} +191 -8
  28. package/dist/{chunk-ZW6L275N.js → chunk-HHFZXOBC.js} +12 -14
  29. package/dist/{chunk-AMEM2ZLL.js → chunk-INOUUSYI.js} +29 -9
  30. package/dist/{chunk-XFFUXXI4.js → chunk-JBCOUY4M.js} +3 -3
  31. package/dist/{chunk-YEVPRO7L.js → chunk-JQSZTQSK.js} +81 -52
  32. package/dist/{chunk-TDAQHYM4.js → chunk-K2UAQWYO.js} +3 -3
  33. package/dist/{chunk-ZYKFYNES.js → chunk-KM2HLQE3.js} +2 -2
  34. package/dist/{chunk-DXJTBU7A.js → chunk-LUHIN4UZ.js} +3 -3
  35. package/dist/{chunk-SOI6K5DY.js → chunk-MOI2KDLH.js} +1 -1
  36. package/dist/{chunk-QDVGOMSC.js → chunk-NW26E4YU.js} +3 -3
  37. package/dist/{chunk-YIBFGAYI.js → chunk-O4Z2MNNL.js} +6 -6
  38. package/dist/{chunk-L26V6ILJ.js → chunk-OGPEHSNW.js} +1 -1
  39. package/dist/{chunk-2JB4GD34.js → chunk-OQLF3MQQ.js} +3 -4
  40. package/dist/{chunk-Z5IW4DHH.js → chunk-OS7DJOQJ.js} +1 -1
  41. package/dist/{chunk-DA3PLB5N.js → chunk-PAK5P2ND.js} +1 -1
  42. package/dist/{chunk-3IH6K7KG.js → chunk-PFHTT4PP.js} +5 -5
  43. package/dist/{chunk-PA6CK6WQ.js → chunk-PXGU3GKY.js} +1 -1
  44. package/dist/{chunk-YGSY2NWU.js → chunk-QANM5COC.js} +6 -6
  45. package/dist/{chunk-K5Q6T7SE.js → chunk-QQP3S5FU.js} +3 -3
  46. package/dist/{chunk-62LXQM7U.js → chunk-RFVIQLNB.js} +5 -5
  47. package/dist/{chunk-E4ASIOVL.js → chunk-RHV5SRI2.js} +3 -3
  48. package/dist/{chunk-6LBSAW6I.js → chunk-SI6WDF3U.js} +1 -1
  49. package/dist/chunk-SUOZYOWO.js +51 -0
  50. package/dist/{chunk-MZBQTVFG.js → chunk-SYVRBBLW.js} +1 -1
  51. package/dist/{chunk-5HZGLLNW.js → chunk-TBKV4L2W.js} +5 -5
  52. package/dist/{chunk-GH246BGV.js → chunk-TFPNPS4Q.js} +1 -1
  53. package/dist/{chunk-NBZ7XBT6.js → chunk-UMYYYF7B.js} +1 -1
  54. package/dist/{chunk-Z4KWHSO4.js → chunk-UN3SQTVL.js} +7 -7
  55. package/dist/{chunk-ZVLSYWDF.js → chunk-UO4FQAOX.js} +16 -12
  56. package/dist/{chunk-4Y54SQXH.js → chunk-VJ34F55N.js} +105 -44
  57. package/dist/{chunk-272AKVRP.js → chunk-YHKU2NOZ.js} +1 -1
  58. package/dist/{chunk-F5UL23I2.js → chunk-YNMVVQOQ.js} +1 -1
  59. package/dist/{claude-launcher-MORG66PJ.js → claude-launcher-OQZNW7XJ.js} +1 -1
  60. package/dist/{cli-XI7RUSC5.js → cli-G3P2B2XE.js} +124 -118
  61. package/dist/{command-BJSHY6OB.js → command-4XOXVWFW.js} +169 -48
  62. package/dist/config-QASNKYM6.js +16 -0
  63. package/dist/{connect-cmd-YAUOCX4X.js → connect-cmd-MEDWMW3L.js} +8 -9
  64. package/dist/{container-start-QADK3YGL.js → container-start-2DHCWV73.js} +34 -36
  65. package/dist/{context-show-cmd-VHY3OBIA.js → context-show-cmd-VSFCG663.js} +9 -10
  66. package/dist/{control-plane-launch-QSBWTA2V.js → control-plane-launch-XBGHM7DB.js} +5 -6
  67. package/dist/{dist-ZAHCXYSG.js → dist-QGN5R4Y2.js} +1 -1
  68. package/dist/{docker-DJ73SZRC.js → docker-TAC6G4VU.js} +6 -8
  69. package/dist/{doctor-UR76MCGI.js → doctor-LK6E3XOW.js} +68 -43
  70. package/dist/{emit-artifact-cmd-DP2EQ54N.js → emit-artifact-cmd-L4REOPWX.js} +13 -14
  71. package/dist/{emit-cmd-7NMNKDK7.js → emit-cmd-7TU3JBJ2.js} +2 -2
  72. package/dist/{emit-criteria-cmd-TTFBN6RK.js → emit-criteria-cmd-QVFOQARC.js} +10 -11
  73. package/dist/{emit-demo-cmd-Z7YGLEBJ.js → emit-demo-cmd-L4B6OOTV.js} +15 -16
  74. package/dist/{emit-finding-cmd-IQRD3J2X.js → emit-finding-cmd-YXFCIWMU.js} +10 -11
  75. package/dist/{emit-result-cmd-GIWB6UHH.js → emit-result-cmd-NI4LCTUM.js} +12 -13
  76. package/dist/{emit-step-cmd-PU5TTU6C.js → emit-step-cmd-HWAUCZZB.js} +10 -11
  77. package/dist/{exec-client-7PT4W7JR.js → exec-client-QB4OZRGM.js} +3 -4
  78. package/dist/find-unit-4UR647S4.js +18 -0
  79. package/dist/{findings-cmd-7J5SHCUO.js → findings-cmd-O2IBO25E.js} +10 -11
  80. package/dist/{fleet-readiness-G63D76EX.js → fleet-readiness-NJYTQYTA.js} +5 -6
  81. package/dist/{governing-source-DLESDP6T.js → governing-source-JCI7VDQ6.js} +12 -13
  82. package/dist/{guest-init-J3F3AEEY.js → guest-init-IF5LXGUL.js} +4 -5
  83. package/dist/{hook-fast-VQXRDS6E.js → hook-fast-GPUL7T77.js} +1 -1
  84. package/dist/host-key-5RU322O3.js +9 -0
  85. package/dist/{image-tag-ADSLWXBA.js → image-tag-SEMBVB5D.js} +3 -4
  86. package/dist/index.js +4 -4
  87. package/dist/{init-KSXU4PA7.js → init-2CEULE3F.js} +25 -27
  88. package/dist/{init-67R7LO4C.js → init-FAIF7KOK.js} +25 -27
  89. package/dist/{init-cmd-MNOVMADM.js → init-cmd-HZUUMO45.js} +13 -14
  90. package/dist/{init-update-6KEXRCJH.js → init-update-TTMFFNMB.js} +12 -13
  91. package/dist/{install-cmd-FV7IZ7XF.js → install-cmd-TWGRGEVL.js} +5 -6
  92. package/dist/{logs-HI46FO6Z.js → logs-6CMB3DO6.js} +2 -3
  93. package/dist/{loop-KUEOPBKX.js → loop-7U7MVICV.js} +41 -43
  94. package/dist/{machine-EQEAPT76.js → machine-S3JHOX4V.js} +25 -27
  95. package/dist/{mcp-serve-cmd-7ABBV2QE.js → mcp-serve-cmd-MWGIN6YL.js} +4 -5
  96. package/dist/{paths-7HVTDE6J.js → paths-T2DEBI62.js} +2 -3
  97. package/dist/pending-ERXWVLLG.js +9 -0
  98. package/dist/{pidfile-5UDLYPMC.js → pidfile-EAD2OEM7.js} +3 -4
  99. package/dist/{record-PPZEXAVA.js → record-IMXQNHPB.js} +3 -4
  100. package/dist/runner-env-BJPUHAKZ.js +18 -0
  101. package/dist/runner-identity-ZCPPC2BJ.js +13 -0
  102. package/dist/{runner-key-ML7R33HF.js → runner-key-CYSUYKSX.js} +25 -27
  103. package/dist/{session-sender-A43GZQ7T.js → session-sender-5T7BXPKC.js} +13 -14
  104. package/dist/{spec-cmd-VVUJZSG2.js → spec-cmd-4ABYAFNZ.js} +11 -12
  105. package/dist/{status-4G6K7I2C.js → status-2AP7J2L7.js} +32 -34
  106. package/dist/{sync-cmd-ZEC65ABJ.js → sync-cmd-34CGNA6T.js} +12 -13
  107. package/dist/{update-steps-XLO7734I.js → update-steps-JQOCCDWO.js} +33 -35
  108. package/dist/{watch-QB4AMWR3.js → watch-6HU7LCUY.js} +12 -13
  109. package/dist/{work-claim-cmd-6W3GBHRS.js → work-claim-cmd-5QKLHSCR.js} +17 -19
  110. package/dist/{work-cmd-LTZXOPPN.js → work-cmd-3MKUIE2C.js} +10 -11
  111. package/dist/{work-comment-cmd-LDZBUO6M.js → work-comment-cmd-ESC3DSHI.js} +11 -12
  112. package/dist/{work-demo-cmd-77LISWQ3.js → work-demo-cmd-7S23DGYO.js} +10 -11
  113. package/dist/{work-logs-cmd-FK7HE7PC.js → work-logs-cmd-46UPNN7Q.js} +10 -11
  114. package/dist/{work-open-pr-cmd-WVONEHZL.js → work-open-pr-cmd-JNGTGLIP.js} +11 -12
  115. package/dist/{work-pr-cmd-6IPXWJEH.js → work-pr-cmd-2J2LKETD.js} +10 -11
  116. package/dist/{work-proofs-cmd-TGIAP5IO.js → work-proofs-cmd-HRWTHYSS.js} +11 -12
  117. package/dist/{work-proofs-record-XPAU7N57.js → work-proofs-record-6OKAT3IC.js} +18 -19
  118. package/dist/{work-stop-cmd-UJ45EV3A.js → work-stop-cmd-Y22XIVQ6.js} +10 -11
  119. package/package.json +1 -1
  120. package/dist/build-LSU25G3M.js +0 -14
  121. package/dist/chunk-3Z3MPR55.js +0 -226
  122. package/dist/chunk-HACGUL52.js +0 -183
  123. package/dist/config-WRHQDGVI.js +0 -18
  124. package/dist/host-key-UERIQRE6.js +0 -10
  125. package/dist/inspect-DNLXTXLA.js +0 -6
  126. package/dist/install-OCBERTPQ.js +0 -19
  127. package/dist/pending-5HZACM2V.js +0 -10
  128. package/dist/runner-env-L7OPH3O3.js +0 -20
  129. package/dist/runner-identity-VASV2AEQ.js +0 -15
  130. package/dist/{chunk-2AIOOU3A.js → chunk-KPHRRCUY.js} +1 -1
@@ -1,35 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { readsJobState, READ_JOB_STATE_FORMATS, jobStateFormatOf } from './chunk-ZVB57WI6.js';
4
- import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-HVRQQOMH.js';
5
- import { writeDockerClientConfig } from './chunk-6LBSAW6I.js';
4
+ import { DOCKERD_LOG, HELPER_PATH, HELPER_RECORD } from './chunk-63IVRRIO.js';
6
5
  import { zodProblem } from './chunk-I3LTIAOR.js';
7
- import { senderPidfile } from './chunk-XFFUXXI4.js';
8
- import { installScrubContext } from './chunk-YGSY2NWU.js';
9
- import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, stopJailed, deleteBuildDisk, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-YEVPRO7L.js';
10
- import { readBranchHead, fetchCommit, diffBetween } from './chunk-ZVLSYWDF.js';
6
+ import { senderPidfile } from './chunk-JBCOUY4M.js';
7
+ import { installScrubContext } from './chunk-QANM5COC.js';
8
+ import { writeDockerClientConfig } from './chunk-SI6WDF3U.js';
9
+ import { ADDED_USER, shellQuote, GH_CONFIG_YML, ghHostsYml, hasClaudeCredential, AssetError, obtainImage, ensureRootfs, makeBuildsDirPrivate, gitRemoteFor, startServicesFor, createLeaseChannel, createBuildDisk, machineConfig, startJailedInto, resolveAgentUser, AgentUserError, runBuildSteps, startHostServices, LEASE_SECONDS, createContainerRuntime, stopContainer, cleanupContainer, outOfMemoryReason, closeHostBuild, dropManagedClaudeKey, containerSenderCommand, hostCommandEnvironment, execArgv, signalInContainer, syncInContainer, copyTranscriptsFromContainer, MANAGED_UNJAILED_REASON, senderAliveScript, helperFirecrackerNote, managedClaudeKeyValues, stopJailed, deleteBuildDisk, managedClaudeKeyFor, startCheckContainer, lifecycleSteps, lifecycleFailureReason, writeEvalInput, DeliveryFailure, EVAL_INPUT_NAME, copyTranscripts, senderSignalScript, containerJudgeEnvironment, ROOT_DISK_ID_PREFIX, copyJudgeTree } from './chunk-JQSZTQSK.js';
10
+ import { readBranchHead, fetchCommit, diffBetween } from './chunk-UO4FQAOX.js';
11
+ import { waitForAgent, vmExecArgs } from './chunk-2ILU7UAU.js';
12
+ import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-OGPEHSNW.js';
13
+ import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, WORKFLOW_PERMISSION_REASON, keptContextTree } from './chunk-RFVIQLNB.js';
14
+ import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-2D6CKNR7.js';
15
+ import { DEFAULT_CACHE_DISK, formatBytes, allocatedBytes } from './chunk-KM2HLQE3.js';
16
+ import { parseSize, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-5AFPP3GZ.js';
17
+ import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-4UPET3R7.js';
11
18
  import { isSameProcess, startTimeOf } from './chunk-JBJTC3UU.js';
12
- import { waitForAgent, vmExecArgs } from './chunk-5THSC6BD.js';
13
- import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-L26V6ILJ.js';
14
- import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, WORKFLOW_PERMISSION_REASON, keptContextTree } from './chunk-62LXQM7U.js';
15
- import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-3CKMB2UK.js';
16
- import { DEFAULT_CACHE_DISK, formatBytes, allocatedBytes } from './chunk-ZYKFYNES.js';
17
- import { parseSize, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, writeJobFile, readJobFile, childEnvironment, withAnswerProtocol, judgeCommand, MAX_REPORT_BYTES, JUDGE_MAX_TURNS, JUDGE_DIR, COMMAND_DIR, MAX_ITEMS_BYTES } from './chunk-43I7PXDP.js';
18
- import { CLAUDE_CODE_VERSION, FIRECRACKER_VERSION } from './chunk-ES4ULBAL.js';
19
- import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-Z4KWHSO4.js';
19
+ import { WorkCommandError, postJson, isSignatureRefusal, getJson } from './chunk-UN3SQTVL.js';
20
20
  import { planArtifactUpload } from './chunk-MECW77XP.js';
21
- import { scrubText } from './chunk-6ZFY2L2T.js';
22
21
  import { readCloudConfig } from './chunk-PJDQPF5N.js';
23
- import { signerFor } from './chunk-SOI6K5DY.js';
24
- import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-PA6CK6WQ.js';
25
- import { JOB_MOUNT, claudeCredential, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, buildMavenSettingsXml, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, MAVEN_SETTINGS_FILE, checkEnvironment, EVAL_INPUT_DIR } from './chunk-BALIE3BA.js';
22
+ import { signerFor } from './chunk-MOI2KDLH.js';
26
23
  import { resolvePackRoot } from './chunk-ZQSANKS4.js';
24
+ import { scrubText } from './chunk-AJYZNISW.js';
27
25
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
28
26
  import { resolveVersion } from './chunk-RA3O54FC.js';
29
27
  import { parsePolicy } from './chunk-FGXT5OXS.js';
30
28
  import { CheckItemsSchema, CHECK_ITEM_REASON_MAX_LENGTH } from './chunk-EOTMDIYC.js';
31
29
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
32
- import { fdName } from './chunk-HACGUL52.js';
30
+ import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-PXGU3GKY.js';
31
+ import { JOB_MOUNT, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, claudeCredential, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, fdName, buildMavenSettingsXml, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, managedClaudeCredential, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, MAVEN_SETTINGS_FILE, checkEnvironment, EVAL_INPUT_DIR } from './chunk-G4W4B33M.js';
33
32
  import { RUNNER_WORDED_REASONS, UNKNOWN_TRACKING_REASON } from './chunk-MESOOLF4.js';
34
33
  import { existsSync, statSync, appendFileSync, rmSync, mkdirSync, chmodSync, writeFileSync, openSync, readFileSync, closeSync, readdirSync, lstatSync, fstatSync, readSync, realpathSync } from 'fs';
35
34
  import { join, dirname, delimiter, sep } from 'path';
@@ -297,7 +296,7 @@ async function provisionMicroVm(input) {
297
296
  const tag = `#${item.number}`;
298
297
  const logPath = join(jobDir, "provision.log");
299
298
  const fail = (reason) => ({ ok: false, reason });
300
- if (claudeCredential(runtime.hostEnv) === void 0) return fail(AGENT_CREDENTIAL_MISSING);
299
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
301
300
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
302
301
  const primary = primaryOf(repositories);
303
302
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -2238,7 +2237,7 @@ async function runJudge(input) {
2238
2237
  const brief = check.judge.text;
2239
2238
  if (brief === void 0) return await fail(check, `the brief ${check.judge.brief} is not in the definitions repository`);
2240
2239
  if (tokens === void 0) return await fail(check, "the build's repository tokens are no longer held, so the branch cannot be fetched");
2241
- const credential = claudeCredential(runtime.hostEnv);
2240
+ const credential = config.managed === true && managedClaudeKeyFor(jobDir) !== void 0 ? managedClaudeCredential() : claudeCredential(runtime.hostEnv);
2242
2241
  if (credential === void 0) return await fail(check, "the host holds no Claude credential for the judge");
2243
2242
  const branch = job.branch;
2244
2243
  if (branch === void 0) return await fail(check, "the build pushed no branch: the claim names none");
@@ -2635,7 +2634,7 @@ function mergeScrubConfig(a, b) {
2635
2634
  function releaseScrub(config, home) {
2636
2635
  const merged = mergeScrubConfig(config.scrub, readCloudConfig(home).scrub);
2637
2636
  const secrets = [...headerVariables(config.build?.destinations), ...CLAUDE_CREDENTIAL_VARIABLES].map((name) => process.env[name] ?? "");
2638
- const held = [currentClaudeCredential(process.env)?.value, ...removedClaudeCredentialValues()].filter((value) => value !== void 0);
2637
+ const held = [currentClaudeCredential(process.env)?.value, ...removedClaudeCredentialValues(), ...managedClaudeKeyValues()].filter((value) => value !== void 0);
2639
2638
  return { literals: [...scrubList(merged?.literals), ...secrets, ...held], patterns: scrubList(merged?.patterns) };
2640
2639
  }
2641
2640
  function transcriptScrub(config, secrets) {
@@ -3222,6 +3221,7 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
3222
3221
  await held.revokeAll();
3223
3222
  deps.container.credentials.delete(jobDirPath);
3224
3223
  }
3224
+ dropManagedClaudeKey(jobDirPath);
3225
3225
  if (outcome !== void 0) {
3226
3226
  const fromHook = readReasonLine(jobDirPath, config);
3227
3227
  if (verdictReason !== void 0) {
@@ -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-PA6CK6WQ.js';
3
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PXGU3GKY.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
+ import { DEFAULT_DASHBOARD } from './chunk-Y5YCX6AL.js';
3
4
  import { sanitizeTerminal } from './chunk-MECW77XP.js';
4
- import { remoteLookupFailed } from './chunk-6ZFY2L2T.js';
5
5
  import { isAgentsMdLayout } from './chunk-NKOM4JKY.js';
6
- import { DEFAULT_DASHBOARD } from './chunk-Y5YCX6AL.js';
7
- import { cliFetch, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
6
+ import { cliFetch, resolveGatewayCredentials } from './chunk-3N77LUQI.js';
8
7
  import { readCloudConfig } from './chunk-PJDQPF5N.js';
9
8
  import { findGitDirs, writeRepoConnection, readRepoConnection } from './chunk-BJ3KTMDH.js';
9
+ import { remoteLookupFailed } from './chunk-AJYZNISW.js';
10
10
  import { cliInvocation } from './chunk-CRB3POP4.js';
11
11
  import { execFileSync } from 'child_process';
12
12
  import { lstatSync } from 'fs';
@@ -1,14 +1,193 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseRunnerEnv } from './chunk-HACGUL52.js';
4
3
  import { TARGET_TUNNEL, TARGET_LEASE, destinationTarget } from './chunk-MESOOLF4.js';
5
- import { readFileSync, mkdirSync, writeFileSync, existsSync, unlinkSync, chmodSync } from 'fs';
4
+ import { spawn, spawnSync } from 'child_process';
5
+ import { statSync, readFileSync, mkdirSync, writeFileSync, existsSync, unlinkSync, chmodSync } from 'fs';
6
6
  import { join, dirname } from 'path';
7
7
  import { request as request$1, createServer } from 'http';
8
8
  import { request } from 'https';
9
9
  import { createServer as createServer$1 } from 'net';
10
10
 
11
11
  createRequire(import.meta.url);
12
+ var FD_STORE_ENV = "OUTERLAYER_FD_STORE";
13
+ var MIN_SYSTEMD = 254;
14
+ var LISTEN_FDS_START = 3;
15
+ var FD_SLOTS_PER_BUILD = 64;
16
+ function fdName(buildId, socket) {
17
+ return `ol-${buildId}-${socket}`;
18
+ }
19
+ function listenFdOf(server) {
20
+ const handle = server._handle;
21
+ return typeof handle?.fd === "number" && handle.fd >= 0 ? handle.fd : void 0;
22
+ }
23
+ function parseListenFds(env, pid) {
24
+ const found = /* @__PURE__ */ new Map();
25
+ if (env.LISTEN_PID !== String(pid)) return found;
26
+ const count = Number(env.LISTEN_FDS);
27
+ if (!Number.isInteger(count) || count <= 0) return found;
28
+ const names = (env.LISTEN_FDNAMES ?? "").split(":");
29
+ for (let index = 0; index < count; index++) {
30
+ const name = names[index];
31
+ if (name !== void 0 && name !== "" && name !== "stored") found.set(name, LISTEN_FDS_START + index);
32
+ }
33
+ return found;
34
+ }
35
+ function listenOnFd(server, fd) {
36
+ return new Promise((resolve, reject) => {
37
+ server.once("error", reject);
38
+ server.listen({ fd }, () => {
39
+ server.off("error", reject);
40
+ resolve();
41
+ });
42
+ });
43
+ }
44
+ function run(spawnFn, command, args, fd) {
45
+ return new Promise((resolve) => {
46
+ let stdout = "";
47
+ let stderr = "";
48
+ let child;
49
+ try {
50
+ child = spawnFn(command, args, { stdio: ["ignore", "pipe", "pipe", ...fd === void 0 ? [] : [fd]] });
51
+ } catch (err) {
52
+ resolve({ status: null, stdout, stderr: err instanceof Error ? err.message : String(err) });
53
+ return;
54
+ }
55
+ child.stdout?.on("data", (chunk) => stdout += chunk.toString("utf8"));
56
+ child.stderr?.on("data", (chunk) => stderr += chunk.toString("utf8"));
57
+ child.on("error", (err) => resolve({ status: null, stdout, stderr: err.message }));
58
+ child.on("close", (status) => resolve({ status, stdout, stderr }));
59
+ });
60
+ }
61
+ function systemdVersion(ran) {
62
+ const match = /^systemd (\d+)/.exec(ran.stdout);
63
+ return ran.status === 0 && match !== null ? Number(match[1]) : void 0;
64
+ }
65
+ function realFdStorePort(options = {}) {
66
+ const env = options.env ?? process.env;
67
+ const pid = options.pid ?? process.pid;
68
+ const command = options.command ?? "systemd-notify";
69
+ const spawnFn = options.spawn ?? spawn;
70
+ let inherited;
71
+ let held2;
72
+ let version;
73
+ const inheritedNames = () => inherited ??= parseListenFds(env, pid);
74
+ const heldNames = () => held2 ??= new Set(inheritedNames().keys());
75
+ return {
76
+ async status() {
77
+ if (env.NOTIFY_SOCKET === void 0 || env.NOTIFY_SOCKET === "") return { ok: false, reason: "NOTIFY_SOCKET is not set, so this runner was not started by a service that accepts descriptors" };
78
+ const size = Number(env[FD_STORE_ENV]);
79
+ if (!Number.isInteger(size) || size <= 0) return { ok: false, reason: `${FD_STORE_ENV} is not set, so the service's unit keeps no descriptor store` };
80
+ version ??= run(spawnFn, command, ["--version"]).then(systemdVersion);
81
+ const found = await version;
82
+ if (found === void 0) return { ok: false, reason: `${command} could not be run, so no descriptor can be stored` };
83
+ if (found < MIN_SYSTEMD) return { ok: false, reason: `systemd ${found} cannot store a descriptor sent from a child process: it needs systemd ${MIN_SYSTEMD} or later` };
84
+ return { ok: true };
85
+ },
86
+ async push(name, server) {
87
+ const fd = listenFdOf(server);
88
+ if (fd === void 0) throw new Error(`${name} has no descriptor to store`);
89
+ const size = Number(env[FD_STORE_ENV]);
90
+ const names = heldNames();
91
+ if (Number.isInteger(size) && names.size >= size) {
92
+ throw new Error(`the descriptor store is full: it holds ${names.size} descriptors, the size the service's unit sets (FileDescriptorStoreMax=${size})`);
93
+ }
94
+ const ran = await run(spawnFn, command, [`--fd=${LISTEN_FDS_START}`, `--fdname=${name}`, "FDSTORE=1"], fd);
95
+ if (ran.status !== 0) throw new Error(`storing ${name} failed${ran.status === null ? "" : ` (exit ${ran.status})`}: ${ran.stderr.trim().split("\n")[0] ?? ""}`);
96
+ names.add(name);
97
+ },
98
+ async remove(name) {
99
+ const ran = await run(spawnFn, command, ["FDSTOREREMOVE=1", `FDNAME=${name}`]);
100
+ if (ran.status !== 0) throw new Error(`removing ${name} from the store failed${ran.status === null ? "" : ` (exit ${ran.status})`}: ${ran.stderr.trim().split("\n")[0] ?? ""}`);
101
+ heldNames().delete(name);
102
+ },
103
+ inherited() {
104
+ return inheritedNames();
105
+ },
106
+ listenOn: listenOnFd
107
+ };
108
+ }
109
+
110
+ // src/runner/service/slice.ts
111
+ var BUILD_SLICE_MEMORY_ENV = "OUTERLAYER_BUILD_SLICE_MEMORY";
112
+
113
+ // src/runner/service/inspect.ts
114
+ var CREDENTIAL_VARIABLES = ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY"];
115
+ function property(shown, name) {
116
+ return new RegExp(`^${name}=(.*)$`, "m").exec(shown)?.[1]?.trim();
117
+ }
118
+ function holdsGroup(status, gid) {
119
+ const primary = /^Gid:\s+(\d+)/m.exec(status)?.[1];
120
+ const supplementary = /^Groups:[ \t]*(.*)$/m.exec(status)?.[1]?.trim().split(/\s+/).filter((g) => g !== "") ?? [];
121
+ return [primary, ...supplementary].some((g) => g !== void 0 && Number(g) === gid);
122
+ }
123
+ function parseRunnerEnv(text) {
124
+ const env = {};
125
+ for (const line of text.split("\n")) {
126
+ const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)=(.*)$/.exec(line);
127
+ if (match === null) continue;
128
+ env[match[1]] = match[2].trim().replace(/^(["'])(.*)\1$/, "$2");
129
+ }
130
+ return env;
131
+ }
132
+ function credentialNames(env) {
133
+ const set = parseRunnerEnv(env ?? "");
134
+ return CREDENTIAL_VARIABLES.filter((name) => (set[name] ?? "").trim() !== "");
135
+ }
136
+ function startedWithStore(environ) {
137
+ const vars = new Map(environ.split("\0").map((entry) => [entry.slice(0, entry.indexOf("=")), entry.slice(entry.indexOf("=") + 1)]));
138
+ return (vars.get("NOTIFY_SOCKET") ?? "") !== "" && Number(vars.get(FD_STORE_ENV)) > 0;
139
+ }
140
+ function inspectService(unit, configDir, probes) {
141
+ const shown = probes.show(unit);
142
+ if (shown === void 0 || property(shown, "LoadState") !== "loaded") return void 0;
143
+ const pid = Number(property(shown, "MainPID") ?? "0");
144
+ const mainPid = Number.isInteger(pid) && pid > 0 ? pid : void 0;
145
+ const delegate = property(shown, "Delegate");
146
+ const storeMax = Number(property(shown, "FileDescriptorStoreMax"));
147
+ const status = mainPid === void 0 ? void 0 : probes.readFile(`/proc/${mainPid}/status`);
148
+ const environ = mainPid === void 0 ? void 0 : probes.readFile(`/proc/${mainPid}/environ`);
149
+ const systemd = Number(/^systemd (\d+)/.exec(probes.systemctlVersion?.() ?? "")?.[1]);
150
+ const kvm = probes.kvmGid();
151
+ const sliceMemory = Number(new RegExp(`(?:^|\\s)${BUILD_SLICE_MEMORY_ENV}=(\\d+)(?:\\s|$)`).exec(property(shown, "Environment") ?? "")?.[1]);
152
+ return {
153
+ unit,
154
+ ...Number.isSafeInteger(sliceMemory) && sliceMemory > 0 ? { buildSliceMemory: sliceMemory } : {},
155
+ mainPid,
156
+ delegate: delegate === void 0 ? void 0 : delegate !== "no",
157
+ ...Number.isInteger(storeMax) && property(shown, "FileDescriptorStoreMax") !== void 0 ? { fdStoreMax: storeMax } : {},
158
+ hasKvmGroup: status === void 0 || kvm === void 0 ? void 0 : holdsGroup(status, kvm),
159
+ ...environ === void 0 ? {} : { startedWithStore: startedWithStore(environ) },
160
+ ...systemd > 0 ? { systemdVersion: systemd } : {},
161
+ // `claude.env` first, where the service loads the credential from; `runner.env` holds one that was never moved.
162
+ credentialVariables: [.../* @__PURE__ */ new Set([...credentialNames(probes.readFile(join(configDir, "claude.env"))), ...credentialNames(probes.readFile(join(configDir, "runner.env")))])]
163
+ };
164
+ }
165
+ function realInspectProbes() {
166
+ return {
167
+ show: (unit) => {
168
+ const result = spawnSync("systemctl", ["show", "--property=LoadState,MainPID,Delegate,FileDescriptorStoreMax,Environment", unit], { encoding: "utf8", timeout: 1e4 });
169
+ return result.status === 0 ? result.stdout : void 0;
170
+ },
171
+ readFile: (path) => {
172
+ try {
173
+ return readFileSync(path, "utf8");
174
+ } catch {
175
+ return void 0;
176
+ }
177
+ },
178
+ systemctlVersion: () => {
179
+ const result = spawnSync("systemctl", ["--version"], { encoding: "utf8", timeout: 1e4 });
180
+ return result.status === 0 ? result.stdout : void 0;
181
+ },
182
+ kvmGid: () => {
183
+ try {
184
+ return statSync("/dev/kvm").gid;
185
+ } catch {
186
+ return void 0;
187
+ }
188
+ }
189
+ };
190
+ }
12
191
  var CLAUDE_CREDENTIAL_ID = "claude";
13
192
  var CLAUDE_ENV_FILE = "claude.env";
14
193
  function claudeEnvPath(configPath) {
@@ -125,6 +304,9 @@ function claudeCredential(hostEnv, options = {}) {
125
304
  if (credential === void 0) return void 0;
126
305
  return { variable: credential.variable, placeholder: credential.variable === "CLAUDE_CODE_OAUTH_TOKEN" ? OAUTH_PLACEHOLDER : API_KEY_PLACEHOLDER };
127
306
  }
307
+ function managedClaudeCredential() {
308
+ return { variable: "ANTHROPIC_API_KEY", placeholder: API_KEY_PLACEHOLDER };
309
+ }
128
310
  function gatewayUpstream(gatewayUrl) {
129
311
  return `${new URL(gatewayUrl).origin}/`;
130
312
  }
@@ -142,8 +324,9 @@ function forwardedEnvironment(hostEnv) {
142
324
  return env;
143
325
  }
144
326
  function builtInDestinations(input) {
145
- const credential = claudeCredential(input.hostEnv);
146
- const apiKeyMode = credential?.variable === "ANTHROPIC_API_KEY";
327
+ const managedKey = input.claudeApiKey !== void 0 && input.claudeApiKey !== "";
328
+ const credential = managedKey ? void 0 : claudeCredential(input.hostEnv);
329
+ const apiKeyMode = managedKey || credential?.variable === "ANTHROPIC_API_KEY";
147
330
  return [
148
331
  {
149
332
  destination: {
@@ -163,7 +346,7 @@ function builtInDestinations(input) {
163
346
  header: apiKeyMode ? { name: "x-api-key", value: "${ANTHROPIC_API_KEY}", variables: ["ANTHROPIC_API_KEY"] } : { name: "Authorization", value: "Bearer ${CLAUDE_CODE_OAUTH_TOKEN}", variables: ["CLAUDE_CODE_OAUTH_TOKEN"] },
164
347
  env: {}
165
348
  },
166
- hostEnv: forwardedEnvironment(input.hostEnv),
349
+ hostEnv: managedKey ? { ANTHROPIC_API_KEY: input.claudeApiKey } : forwardedEnvironment(input.hostEnv),
167
350
  // A build's own key in either header would sit beside the runner's, and the upstream takes one of them.
168
351
  drop: ["x-api-key", "authorization"],
169
352
  socket: CLAUDE_SOCKET
@@ -471,7 +654,7 @@ async function startBuildServices(input) {
471
654
  targets.set(destinationTarget(index), (stream) => server.acceptStream(stream));
472
655
  if (server.port !== void 0) destinationPorts.push(server.port);
473
656
  }
474
- const builtIns = input.builtIns === void 0 ? [] : builtInDestinations({ gatewayUrl: input.builtIns.gatewayUrl, itemKey: input.builtIns.itemKey, hostEnv: input.hostEnv, claudeUpstream: input.builtIns.claudeUpstream });
657
+ const builtIns = input.builtIns === void 0 ? [] : builtInDestinations({ gatewayUrl: input.builtIns.gatewayUrl, itemKey: input.builtIns.itemKey, hostEnv: input.hostEnv, claudeUpstream: input.builtIns.claudeUpstream, claudeApiKey: input.builtIns.claudeApiKey });
475
658
  for (const builtIn of builtIns) {
476
659
  const server = await startDestination({
477
660
  destination: builtIn.destination,
@@ -776,7 +959,7 @@ function buildEnvironment(input) {
776
959
  if (skipped) notices.push(MAVEN_NO_PROXY_NOTE);
777
960
  }
778
961
  const destinations = destinationEnvironment(input.config.build?.destinations, containerLocalAddress);
779
- const builtInLiterals = builtIns ? builtInEnvironment(containerBuiltInAddress, claudeCredential(input.hostEnv)) : {};
962
+ const builtInLiterals = builtIns ? builtInEnvironment(containerBuiltInAddress, input.config.managed === true ? managedClaudeCredential() : claudeCredential(input.hostEnv)) : {};
780
963
  const hooksPath = input.identity?.hooksPath;
781
964
  const hooks = {};
782
965
  if (hooksPath !== void 0) {
@@ -867,4 +1050,4 @@ function routesOf(counts) {
867
1050
  return routes.length === 0 ? {} : { routes };
868
1051
  }
869
1052
 
870
- export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILT_IN_NAMES, CHECKOUT_DIR, CHECK_ITEMS_FILE, CLAUDE_CREDENTIAL_ID, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_ENV_FILE, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT, MAVEN_NO_PROXY_NOTE, MAVEN_SETTINGS_FILE, MAVEN_SPACE_NOTE, PROXY_WARNING_FLAG, RELAY_PORT, authorEnvironment, buildEnvironment, buildMavenSettingsXml, builtInEnvironment, checkEnvironment, checkoutPath, claudeCredential, claudeCredentialVariablesSet, claudeEnvPath, commitIdentityRecord, containerLocalAddress, credentialLineIn, currentClaudeCredential, destinationEnvironment, headerVariables, heldClaudeCredential, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, mavenArgs, mavenSettingsXml, namesGlobalSettings, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseUnreachable, primaryOf, proxyEnvironment, readClaudeCredential, removedClaudeCredentialValues, repositoriesOf, repositoryPath, resolveDestinations, sharedUserEnvironment, startBuildServices, takeClaudeCredential, tokenHeader, withGitConfig, withHooksPath, withProxyWarningHidden, withTokenHeader, withTunnelRecord, withoutCredentialLines, writeBuildMavenSettings, writeMavenSettings };
1053
+ export { AGENT_CREDENTIAL_MISSING, BUILD_HOME, BUILD_SLICE_MEMORY_ENV, BUILT_IN_NAMES, CHECKOUT_DIR, CHECK_ITEMS_FILE, CLAUDE_CREDENTIAL_ID, CLAUDE_CREDENTIAL_VARIABLES, CLAUDE_ENV_FILE, CLAUDE_PORT, CLAUDE_SOCKET, DESTINATION_BASE_PORT, EVAL_INPUT_DIR, FD_SLOTS_PER_BUILD, FD_STORE_ENV, FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, GATEWAY_PORT, GATEWAY_SOCKET, JOB_MOUNT, MAVEN_NO_PROXY_NOTE, MAVEN_SETTINGS_FILE, MAVEN_SPACE_NOTE, MIN_SYSTEMD, PROXY_WARNING_FLAG, RELAY_PORT, authorEnvironment, buildEnvironment, buildMavenSettingsXml, builtInEnvironment, checkEnvironment, checkoutPath, claudeCredential, claudeCredentialVariablesSet, claudeEnvPath, commitIdentityRecord, containerLocalAddress, credentialLineIn, currentClaudeCredential, destinationEnvironment, fdName, headerVariables, heldClaudeCredential, inspectService, isRefusedInConfig, isReservedVariable, lifecycleWorkdir, managedClaudeCredential, mavenArgs, mavenSettingsXml, namesGlobalSettings, parseClaimIdentity, parseClaimedRepositories, parseIsolation, parseRunnerEnv, parseUnreachable, primaryOf, proxyEnvironment, readClaudeCredential, realFdStorePort, realInspectProbes, removedClaudeCredentialValues, repositoriesOf, repositoryPath, resolveDestinations, sharedUserEnvironment, startBuildServices, takeClaudeCredential, tokenHeader, withGitConfig, withHooksPath, withProxyWarningHidden, withTokenHeader, withTunnelRecord, withoutCredentialLines, writeBuildMavenSettings, writeMavenSettings };
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { checkStarterFiles, contextIsGoverned } from './chunk-AP2K4LPI.js';
4
- import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-272AKVRP.js';
5
- import { resolveCredentials, getJson, WorkCommandError } from './chunk-Z4KWHSO4.js';
6
- import { isLinkedRepository } from './chunk-EE2ZZGQV.js';
7
- import { sanitizeTerminal } from './chunk-MECW77XP.js';
8
- import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-6ZFY2L2T.js';
4
+ import { resolveCredentials, getJson, WorkCommandError } from './chunk-UN3SQTVL.js';
5
+ import { isLinkedRepository } from './chunk-FVCHHSHB.js';
9
6
  import { C } from './chunk-ANPNT6PM.js';
7
+ import { fleetCheck, checkBuildSkill, checkMachineSkills, checkCommittedMaintainedSkills, checkMaintainedReferences, checkIgnoredSkillFolders } from './chunk-YHKU2NOZ.js';
8
+ import { sanitizeTerminal } from './chunk-MECW77XP.js';
10
9
  import { checkFormerSkillNames } from './chunk-JWNH4ZTF.js';
11
- import { resolveGatewayCredentials, defaultFetch } from './chunk-6RKD7YZ6.js';
12
- import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-65AKMFBH.js';
10
+ import { resolveGatewayCredentials, defaultFetch } from './chunk-3N77LUQI.js';
11
+ import { sanitizeForContext, spoolDir, assessSyncHealth, readSyncStatus, SYNC_STALE_AFTER_MS, formatAgo, checkInstalledCliStaleness, workspaceRootOf, hookFiredMarkerPath, refreshCommand } from './chunk-25GRRBTH.js';
13
12
  import { readStatuslineState, STATE_FRESH_MS } from './chunk-I7RZHMXW.js';
14
13
  import { hookCommandEscapesControlPlane, CONTROL_PLANE_DIR_VARIABLE } from './chunk-HCVLP7XA.js';
15
14
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
15
+ import { resolveRepoIdentity, compareVersions, SUPPORTED_VERSIONS } from './chunk-AJYZNISW.js';
16
16
  import { cliInvocation } from './chunk-CRB3POP4.js';
17
17
  import { readSettings, settingsPath, isOurStatuslineSlot, statuslineWrappedOriginal, REGISTERED_EVENTS, isOurHookCommand, ourCommandBins, cliBinResolvable, ourDirectScriptBins, wrappedOriginalCommand } from './chunk-URIZRCRY.js';
18
18
  import { readDeliveryRecord, readDegraded, readSourceCache } from './chunk-YQR6E6OV.js';
@@ -1195,8 +1195,8 @@ function doctorExitCode(checks) {
1195
1195
 
1196
1196
  // src/doctor-report.ts
1197
1197
  async function gatherDoctorChecks() {
1198
- const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-LEZ6LAM3.js');
1199
- const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-WRHQDGVI.js');
1198
+ const { DEFAULT_BUILD_DISK, DEFAULT_CACHE_DISK } = await import('./build-disk-ZL46AEN3.js');
1199
+ const { defaultRunnerConfigPath, hasRunnerBlock, loadRunnerConfig, runnerVmOf } = await import('./config-QASNKYM6.js');
1200
1200
  const configPath = defaultRunnerConfigPath();
1201
1201
  const runnerHost = hasRunnerBlock(configPath);
1202
1202
  const hooks = (() => {
@@ -1217,7 +1217,7 @@ async function gatherDoctorChecks() {
1217
1217
  const { runnerVmCheck } = await import('./doctor-53F2PYY7.js');
1218
1218
  checks.push(runnerVmCheck(configPath, { lima: realLima(), home: homeFromEnv(), instance: runnerVm.instance }));
1219
1219
  } else if (hasRunnerBlock(configPath)) {
1220
- const { runnerHostChecks } = await import('./doctor-UR76MCGI.js');
1220
+ const { runnerHostChecks } = await import('./doctor-LK6E3XOW.js');
1221
1221
  const gateway = (() => {
1222
1222
  try {
1223
1223
  const { url, apiKey, appId } = loadRunnerConfig(configPath);
@@ -1244,10 +1244,8 @@ async function gatherDoctorChecks() {
1244
1244
  const service = await (async () => {
1245
1245
  const { existsSync: existsSync3 } = await import('fs');
1246
1246
  if (process.platform !== "linux" || !existsSync3("/run/systemd/system")) return void 0;
1247
- const { inspectService, realInspectProbes } = await import('./inspect-DNLXTXLA.js');
1248
- const { DEFAULT_UNIT_NAME } = await import('./install-OCBERTPQ.js');
1249
- const { dirname: dirname2 } = await import('path');
1250
- return inspectService(DEFAULT_UNIT_NAME, dirname2(configPath), realInspectProbes());
1247
+ const { inspectRunnerService } = await import('./find-unit-4UR647S4.js');
1248
+ return inspectRunnerService(configPath);
1251
1249
  })();
1252
1250
  checks.push(...await runnerHostChecks({ configPath, hooks, gateway, repos, runner, service }));
1253
1251
  }
@@ -1,10 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { builtinKind } from './chunk-3CKMB2UK.js';
4
- import { parseSize } from './chunk-43I7PXDP.js';
5
- import { runnerDir } from './chunk-PA6CK6WQ.js';
6
- import { CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-BALIE3BA.js';
7
- import { FD_SLOTS_PER_BUILD, FD_STORE_ENV } from './chunk-HACGUL52.js';
3
+ import { builtinKind, keepsHostBuilder } from './chunk-2D6CKNR7.js';
4
+ import { parseSize } from './chunk-5AFPP3GZ.js';
5
+ import { runnerDir } from './chunk-PXGU3GKY.js';
6
+ import { FD_SLOTS_PER_BUILD, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-G4W4B33M.js';
8
7
  import { existsSync, readFileSync, writeFileSync, chmodSync, renameSync } from 'fs';
9
8
  import { dirname, join } from 'path';
10
9
  import { spawnSync } from 'child_process';
@@ -35,6 +34,7 @@ User=${unit.user}
35
34
  ExecStart=${unit.execStart}
36
35
  ${unit.helper === void 0 ? "" : `Environment=OUTERLAYER_HELPER_SOCKET=${unit.helper.socket}
37
36
  `}${unit.fdStore === void 0 ? "" : `Environment=${FD_STORE_ENV}=${unit.fdStore}
37
+ `}${unit.sliceMemoryBytes === void 0 ? "" : `Environment=${BUILD_SLICE_MEMORY_ENV}=${unit.sliceMemoryBytes}
38
38
  `}EnvironmentFile=-${escapeUnitPath(`${unit.configDir}/runner.env`)}
39
39
  ${unit.credential === "load" ? `LoadCredential=${CLAUDE_CREDENTIAL_ID}:${credentialPath(`${unit.configDir}/${CLAUDE_ENV_FILE}`)}` : `EnvironmentFile=-${escapeUnitPath(`${unit.configDir}/${CLAUDE_ENV_FILE}`)}`}
40
40
  Restart=on-failure
@@ -64,6 +64,15 @@ function checkFit(input) {
64
64
  const perBuild = parseSize(input.buildMemory);
65
65
  if (perBuild === void 0) return { fits: true };
66
66
  const neededBytes = input.concurrency * perBuild;
67
+ if (input.sliceBytes !== void 0) {
68
+ if (neededBytes <= input.sliceBytes) return { fits: true };
69
+ return {
70
+ fits: false,
71
+ neededBytes,
72
+ availableBytes: input.sliceBytes,
73
+ message: `runner.concurrency ${input.concurrency} times runner.build.memory ${input.buildMemory} needs ${gib(neededBytes)}, and the memory limit of the runner's build slice is ${gib(input.sliceBytes)}`
74
+ };
75
+ }
67
76
  const availableBytes = Math.max(0, input.usableBytes - RUNNER_RESERVE_BYTES);
68
77
  if (neededBytes <= availableBytes) return { fits: true };
69
78
  return {
@@ -173,6 +182,10 @@ function defaultRun(args) {
173
182
 
174
183
  // src/runner/service/install.ts
175
184
  var DEFAULT_UNIT_NAME = "outerlayer-runner";
185
+ function unitNameProblem(name) {
186
+ if (/^[A-Za-z0-9][A-Za-z0-9_.-]{0,63}$/.test(name) && !name.includes("..")) return void 0;
187
+ return `\u2717 --unit-name ${JSON.stringify(name)} is not a unit name. Use up to 64 letters, digits, "_", "-" and ".", with no "..", starting with a letter or digit. Nothing is set up`;
188
+ }
176
189
  var LOAD_CREDENTIAL_SINCE = 247;
177
190
  var CREDENTIAL_FILE_MODE = 384;
178
191
  function prepareCredentialFile(configDir, lines) {
@@ -235,6 +248,12 @@ function attempt(lines, step) {
235
248
  }
236
249
  }
237
250
  var OWN_HOOKS = "the hooks are the host's own executables, so the runner does not write a service for them: run `outerlayer runner install --service --print` to print the unit, and edit it for your hooks";
251
+ function needsHostDocker(request) {
252
+ const provision = builtinKind(request.hooks.provision);
253
+ const cleanup = builtinKind(request.hooks.cleanup);
254
+ if (cleanup === "vm" && !keepsHostBuilder({ hooks: request.hooks, build: { imageBuild: request.imageBuild } }, request.builderDiskPinned)) return false;
255
+ return provision === "container" || provision === "vm" || cleanup === "container" || cleanup === "vm";
256
+ }
238
257
  function installService(request, deps) {
239
258
  const unitName = request.unitName ?? DEFAULT_UNIT_NAME;
240
259
  const unitPath = unitPathFor(unitName);
@@ -251,10 +270,11 @@ function installService(request, deps) {
251
270
  credential,
252
271
  execStart: request.execStart,
253
272
  timeLimitMinutes: request.timeLimitMinutes,
254
- docker: kind === "container" || kind === "vm" || builtinKind(request.hooks.cleanup) === "container" || builtinKind(request.hooks.cleanup) === "vm",
273
+ docker: needsHostDocker(request),
255
274
  ...request.helperSocket !== void 0 && request.helperUnit !== void 0 ? { helper: { unit: request.helperUnit, socket: request.helperSocket } } : {},
256
275
  // A microVM build under the helper keeps its sockets in the descriptor store, so the runner can restart and the build goes on.
257
- ...kind === "vm" && request.helperSocket !== void 0 && request.helperUnit !== void 0 ? { fdStore: Math.max(1, request.concurrency) * FD_SLOTS_PER_BUILD } : {}
276
+ ...kind === "vm" && request.helperSocket !== void 0 && request.helperUnit !== void 0 ? { fdStore: Math.max(1, request.concurrency) * FD_SLOTS_PER_BUILD } : {},
277
+ sliceMemoryBytes: request.buildSliceMemoryBytes
258
278
  });
259
279
  if (request.print === true) return outcome(true, "printed", [], unit);
260
280
  if (own) return outcome(false, "refused", [OWN_HOOKS]);
@@ -281,7 +301,7 @@ function installService(request, deps) {
281
301
  return outcome(false, "refused", ["systemd was not found (/run/systemd/system is missing), so no service is set up. `--print` prints the unit for another service manager"]);
282
302
  }
283
303
  if (kind === "container" || kind === "vm") {
284
- const fit = checkFit({ concurrency: request.concurrency, buildMemory: request.buildMemory, usableBytes: deps.usableMemoryBytes });
304
+ const fit = checkFit({ concurrency: request.concurrency, buildMemory: request.buildMemory, usableBytes: deps.usableMemoryBytes, sliceBytes: request.buildSliceMemoryBytes });
285
305
  if (!fit.fits) return outcome(false, "refused", [`${fit.message}. Nothing is set up: lower runner.concurrency or runner.build.memory, then run this again`]);
286
306
  }
287
307
  const existing = deps.systemd.read(unitPath);
@@ -441,4 +461,4 @@ function uninstallService(request, deps) {
441
461
  return outcome(true, "removed", lines);
442
462
  }
443
463
 
444
- export { DEFAULT_UNIT_NAME, RUNNER_RESERVE_BYTES, UNIT_MARKER, VM_SERVICE_NAME, checkFit, installService, realTaskScheduler, uninstallService, unitPathFor };
464
+ export { DEFAULT_UNIT_NAME, RUNNER_RESERVE_BYTES, UNIT_MARKER, VM_SERVICE_NAME, checkFit, escapeUnitPath, installService, realTaskScheduler, uninstallService, unitNameProblem };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { LiveUploader } from './chunk-YGSY2NWU.js';
4
- import { CaptureDaemon } from './chunk-6ZFY2L2T.js';
5
- import { spoolDir } from './chunk-65AKMFBH.js';
3
+ import { LiveUploader } from './chunk-QANM5COC.js';
4
+ import { spoolDir } from './chunk-25GRRBTH.js';
5
+ import { CaptureDaemon } from './chunk-AJYZNISW.js';
6
6
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
7
7
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
8
8
  import { mkdirSync, writeFileSync, rmSync } from 'fs';