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

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 (116) hide show
  1. package/README.md +6 -0
  2. package/dist/{agent-setup-HEJM3D3V.js → agent-setup-UXUWLV7O.js} +6 -6
  3. package/dist/{bridge-NBCXFTT4.js → bridge-OWCSVCXL.js} +2 -2
  4. package/dist/{build-LSU25G3M.js → build-4HFDZTUX.js} +4 -4
  5. package/dist/{build-disk-LEZ6LAM3.js → build-disk-5ZQHYBO3.js} +6 -6
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-I32JOQII.js → builder-54GLXGFV.js} +5 -5
  8. package/dist/{check-OOUGS65D.js → check-4TQZZOIQ.js} +37 -37
  9. package/dist/{chunk-L26V6ILJ.js → chunk-2RBIW2PD.js} +1 -1
  10. package/dist/{chunk-MZBQTVFG.js → chunk-36T6W5RA.js} +1 -1
  11. package/dist/{chunk-6NUPXDAA.js → chunk-3M6UYJSR.js} +3 -3
  12. package/dist/{chunk-ZVLSYWDF.js → chunk-3NFZN7H6.js} +3 -3
  13. package/dist/{chunk-272AKVRP.js → chunk-3RAAYBSG.js} +1 -1
  14. package/dist/{chunk-3CKMB2UK.js → chunk-4XYC2663.js} +3 -3
  15. package/dist/{chunk-GH246BGV.js → chunk-56ZHWIR2.js} +1 -1
  16. package/dist/{chunk-6LBSAW6I.js → chunk-75KZUBHD.js} +1 -1
  17. package/dist/{chunk-AMEM2ZLL.js → chunk-AABYHGVO.js} +4 -4
  18. package/dist/{chunk-6ZFY2L2T.js → chunk-AJYZNISW.js} +416 -20
  19. package/dist/{chunk-62LXQM7U.js → chunk-AVLLJW5D.js} +5 -5
  20. package/dist/{chunk-FVKH3PMV.js → chunk-BTG5NZHN.js} +4 -4
  21. package/dist/{chunk-QDVGOMSC.js → chunk-BUF6DSSM.js} +3 -3
  22. package/dist/{chunk-ZW6L275N.js → chunk-CCISO7EQ.js} +10 -10
  23. package/dist/{chunk-65AKMFBH.js → chunk-CXQCBAKO.js} +1 -1
  24. package/dist/{chunk-NBZ7XBT6.js → chunk-DUPM5LVJ.js} +1 -1
  25. package/dist/{chunk-5HZGLLNW.js → chunk-E34FRRSW.js} +4 -4
  26. package/dist/{chunk-F5UL23I2.js → chunk-ENFBYN4A.js} +1 -1
  27. package/dist/{chunk-2JB4GD34.js → chunk-EZ7L5IZU.js} +3 -3
  28. package/dist/{chunk-HVRQQOMH.js → chunk-HAEDLXHA.js} +3 -3
  29. package/dist/{chunk-5THSC6BD.js → chunk-IHY457PB.js} +1 -1
  30. package/dist/{chunk-Z4KWHSO4.js → chunk-IW6Z337K.js} +6 -6
  31. package/dist/{chunk-Z5IW4DHH.js → chunk-J246WRLZ.js} +1 -1
  32. package/dist/{chunk-5QBUX5YZ.js → chunk-JEOPIRUR.js} +1 -1
  33. package/dist/{chunk-TDAQHYM4.js → chunk-JZD2NTRH.js} +3 -3
  34. package/dist/{chunk-XFFUXXI4.js → chunk-KDLQGTN6.js} +3 -3
  35. package/dist/{chunk-QMWUPRYQ.js → chunk-LMICI7AY.js} +3 -3
  36. package/dist/{chunk-43I7PXDP.js → chunk-MPDLZCXM.js} +4 -4
  37. package/dist/{chunk-PA6CK6WQ.js → chunk-N7LAEN3T.js} +1 -1
  38. package/dist/{chunk-57L2YAJA.js → chunk-NW5PDZYA.js} +1 -1
  39. package/dist/{chunk-3IH6K7KG.js → chunk-O5G6VQGZ.js} +4 -4
  40. package/dist/{chunk-DA3PLB5N.js → chunk-PAK5P2ND.js} +1 -1
  41. package/dist/{chunk-YEVPRO7L.js → chunk-POGPX7LI.js} +71 -36
  42. package/dist/{chunk-K5Q6T7SE.js → chunk-PSXVAOEB.js} +3 -3
  43. package/dist/{chunk-O6DYCIVW.js → chunk-QOUR4CQ7.js} +2 -2
  44. package/dist/{chunk-ACRRO3MB.js → chunk-RNVBSRZZ.js} +21 -20
  45. package/dist/{chunk-7WM7K2DY.js → chunk-SMMNU65K.js} +28 -15
  46. package/dist/{chunk-DXJTBU7A.js → chunk-T7N3BAOO.js} +3 -3
  47. package/dist/{chunk-6RKD7YZ6.js → chunk-TVGLNHEB.js} +1 -1
  48. package/dist/{chunk-EN3YWO7Q.js → chunk-TVOZOOIW.js} +3 -3
  49. package/dist/{chunk-ZYKFYNES.js → chunk-UC2DKBMS.js} +2 -2
  50. package/dist/{chunk-YGSY2NWU.js → chunk-WIK5KUGK.js} +5 -5
  51. package/dist/{chunk-EE2ZZGQV.js → chunk-XA6PGME5.js} +2 -2
  52. package/dist/{chunk-SOI6K5DY.js → chunk-XLJLR7EK.js} +1 -1
  53. package/dist/{chunk-BALIE3BA.js → chunk-YOBQIXX6.js} +10 -6
  54. package/dist/{chunk-E4ASIOVL.js → chunk-Z76GVJGQ.js} +3 -3
  55. package/dist/{chunk-YIBFGAYI.js → chunk-ZV2JJPDS.js} +6 -6
  56. package/dist/{chunk-4Y54SQXH.js → chunk-ZWLEUSJW.js} +70 -25
  57. package/dist/{claude-launcher-MORG66PJ.js → claude-launcher-JEB5BN7Q.js} +1 -1
  58. package/dist/{cli-XI7RUSC5.js → cli-DY3EGPUB.js} +109 -109
  59. package/dist/{command-BJSHY6OB.js → command-ZAXYAZCI.js} +24 -24
  60. package/dist/{config-WRHQDGVI.js → config-UN3X6AP2.js} +7 -7
  61. package/dist/{connect-cmd-YAUOCX4X.js → connect-cmd-TWM4FEKD.js} +6 -6
  62. package/dist/{container-start-QADK3YGL.js → container-start-JUNBJ7MU.js} +30 -30
  63. package/dist/{context-show-cmd-VHY3OBIA.js → context-show-cmd-K5LRMDEO.js} +7 -7
  64. package/dist/{control-plane-launch-QSBWTA2V.js → control-plane-launch-LHOV2FPA.js} +5 -5
  65. package/dist/{dist-ZAHCXYSG.js → dist-QGN5R4Y2.js} +1 -1
  66. package/dist/{docker-DJ73SZRC.js → docker-YZKRM7IP.js} +5 -5
  67. package/dist/{doctor-UR76MCGI.js → doctor-YOAF7QPL.js} +26 -26
  68. package/dist/{emit-artifact-cmd-DP2EQ54N.js → emit-artifact-cmd-SCF2FKKS.js} +11 -11
  69. package/dist/{emit-criteria-cmd-TTFBN6RK.js → emit-criteria-cmd-B6CKUWTW.js} +8 -8
  70. package/dist/{emit-demo-cmd-Z7YGLEBJ.js → emit-demo-cmd-BNWRETMJ.js} +12 -12
  71. package/dist/{emit-finding-cmd-IQRD3J2X.js → emit-finding-cmd-TPSHNZNE.js} +8 -8
  72. package/dist/{emit-result-cmd-GIWB6UHH.js → emit-result-cmd-J5DXIC2Q.js} +10 -10
  73. package/dist/{emit-step-cmd-PU5TTU6C.js → emit-step-cmd-NPH46KAO.js} +8 -8
  74. package/dist/{exec-client-7PT4W7JR.js → exec-client-ANW4KGMN.js} +3 -3
  75. package/dist/{findings-cmd-7J5SHCUO.js → findings-cmd-4FJDCFL3.js} +8 -8
  76. package/dist/{fleet-readiness-G63D76EX.js → fleet-readiness-OK6534T6.js} +5 -5
  77. package/dist/{governing-source-DLESDP6T.js → governing-source-GNKTNM32.js} +10 -10
  78. package/dist/{guest-init-J3F3AEEY.js → guest-init-C6M7YT3U.js} +4 -4
  79. package/dist/{hook-fast-VQXRDS6E.js → hook-fast-LVTJWAG3.js} +1 -1
  80. package/dist/{pending-5HZACM2V.js → host-key-DUGGHAGR.js} +3 -3
  81. package/dist/{image-tag-ADSLWXBA.js → image-tag-53DJPMSZ.js} +3 -3
  82. package/dist/index.js +4 -4
  83. package/dist/{init-67R7LO4C.js → init-JGYMAOD5.js} +21 -21
  84. package/dist/{init-KSXU4PA7.js → init-RAJKTSPJ.js} +21 -21
  85. package/dist/{init-cmd-MNOVMADM.js → init-cmd-IB3KTYCV.js} +11 -11
  86. package/dist/{init-update-6KEXRCJH.js → init-update-VPWSWDY7.js} +9 -9
  87. package/dist/{install-OCBERTPQ.js → install-QJWJFIWB.js} +8 -8
  88. package/dist/{install-cmd-FV7IZ7XF.js → install-cmd-NP7GULCD.js} +5 -5
  89. package/dist/{logs-HI46FO6Z.js → logs-V6AES5FE.js} +2 -2
  90. package/dist/{loop-KUEOPBKX.js → loop-ZGDZMVFN.js} +36 -36
  91. package/dist/{machine-EQEAPT76.js → machine-LJ3VMGS3.js} +21 -21
  92. package/dist/{mcp-serve-cmd-7ABBV2QE.js → mcp-serve-cmd-DHGCAMJS.js} +4 -4
  93. package/dist/{paths-7HVTDE6J.js → paths-DMKAJVA5.js} +2 -2
  94. package/dist/{host-key-UERIQRE6.js → pending-B55JZFOV.js} +3 -3
  95. package/dist/{pidfile-5UDLYPMC.js → pidfile-XCTXBGA3.js} +3 -3
  96. package/dist/{record-PPZEXAVA.js → record-RQLGRYWG.js} +3 -3
  97. package/dist/{runner-env-L7OPH3O3.js → runner-env-AUG2OIP4.js} +9 -9
  98. package/dist/{runner-identity-VASV2AEQ.js → runner-identity-BQA4SBU6.js} +5 -5
  99. package/dist/{runner-key-ML7R33HF.js → runner-key-ZIF7M7YN.js} +21 -21
  100. package/dist/{session-sender-A43GZQ7T.js → session-sender-VQ4LHJ5K.js} +11 -11
  101. package/dist/{spec-cmd-VVUJZSG2.js → spec-cmd-PXM4FJ2O.js} +9 -9
  102. package/dist/{status-4G6K7I2C.js → status-27EFD2WE.js} +28 -28
  103. package/dist/{sync-cmd-ZEC65ABJ.js → sync-cmd-VAV7TR2A.js} +10 -10
  104. package/dist/{update-steps-XLO7734I.js → update-steps-7YLAFW3E.js} +29 -29
  105. package/dist/{watch-QB4AMWR3.js → watch-42XJSTTB.js} +10 -10
  106. package/dist/{work-claim-cmd-6W3GBHRS.js → work-claim-cmd-HSG4OHFI.js} +14 -14
  107. package/dist/{work-cmd-LTZXOPPN.js → work-cmd-KCBU3RSD.js} +8 -8
  108. package/dist/{work-comment-cmd-LDZBUO6M.js → work-comment-cmd-QIP2OUJC.js} +9 -9
  109. package/dist/{work-demo-cmd-77LISWQ3.js → work-demo-cmd-6IKAG6ES.js} +8 -8
  110. package/dist/{work-logs-cmd-FK7HE7PC.js → work-logs-cmd-RMKJA4AI.js} +8 -8
  111. package/dist/{work-open-pr-cmd-WVONEHZL.js → work-open-pr-cmd-IAVLUUWW.js} +9 -9
  112. package/dist/{work-pr-cmd-6IPXWJEH.js → work-pr-cmd-3U7SVQII.js} +8 -8
  113. package/dist/{work-proofs-cmd-TGIAP5IO.js → work-proofs-cmd-6ZY6ZNNE.js} +9 -9
  114. package/dist/{work-proofs-record-XPAU7N57.js → work-proofs-record-54GBEUJP.js} +15 -15
  115. package/dist/{work-stop-cmd-UJ45EV3A.js → work-stop-cmd-LH5XY4YL.js} +8 -8
  116. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-6LBSAW6I.js';
3
+ import { TUNNEL_PORT, BRIDGE_ADDRESS, BRIDGE_CIDR } from './chunk-75KZUBHD.js';
4
4
  import { startTimeOf } from './chunk-JBJTC3UU.js';
5
- import { EXEC_PORT } from './chunk-L26V6ILJ.js';
6
- import { RELAY_PORT } from './chunk-BALIE3BA.js';
5
+ import { EXEC_PORT } from './chunk-2RBIW2PD.js';
6
+ import { RELAY_PORT } from './chunk-YOBQIXX6.js';
7
7
  import { spawn, spawnSync } from 'child_process';
8
8
  import { symlinkSync, lstatSync, writeFileSync, chmodSync, mkdirSync, existsSync } from 'fs';
9
9
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { EXEC_PORT } from './chunk-L26V6ILJ.js';
3
+ import { EXEC_PORT } from './chunk-2RBIW2PD.js';
4
4
  import { createConnection } from 'net';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-6NUPXDAA.js';
5
- import { workPageUrl } from './chunk-EE2ZZGQV.js';
4
+ import { autoConnect } from './chunk-3M6UYJSR.js';
5
+ import { workPageUrl } from './chunk-XA6PGME5.js';
6
6
  import { sanitizeTerminal } from './chunk-MECW77XP.js';
7
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
7
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
8
8
  import { C } from './chunk-ANPNT6PM.js';
9
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-6RKD7YZ6.js';
10
- import { signRunnerRequest } from './chunk-SOI6K5DY.js';
9
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-TVGLNHEB.js';
10
+ import { signRunnerRequest } from './chunk-XLJLR7EK.js';
11
11
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
12
12
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
13
13
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -446,7 +446,7 @@ async function runWorkLinkSession(opts) {
446
446
  return await linkSession(opts);
447
447
  } catch (err) {
448
448
  if (opts.logFailures) {
449
- const { logHookError } = await import('./hook-fast-VQXRDS6E.js');
449
+ const { logHookError } = await import('./hook-fast-LVTJWAG3.js');
450
450
  const reason = err instanceof Error ? err.message : String(err);
451
451
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
452
452
  }
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { currentLink } from './chunk-NBZ7XBT6.js';
3
+ import { currentLink } from './chunk-DUPM5LVJ.js';
4
4
  import { readFileSync, statSync, chmodSync, mkdirSync, writeFileSync, renameSync, rmSync, existsSync, lstatSync, accessSync, constants, realpathSync } from 'fs';
5
5
  import { randomBytes } from 'crypto';
6
6
  import { join, dirname, delimiter, resolve } from 'path';
@@ -5,7 +5,7 @@ import { addStdioMcpEntryIfAbsent, addDocsMcpEntryIfAbsent, DOCS_MCP_SERVER_NAME
5
5
  import { installStarterPack } from './chunk-4P6QGMPN.js';
6
6
  import { AGENTS_MD_LAYOUT, declareAgentsMdLayout, linkClaudeSkills, SKILLS_LINK_PATH, describeSkillsLink, isAgentsMdLayout, holdsTodaysLayoutSources, discoverOuterlayerPaths } from './chunk-NKOM4JKY.js';
7
7
  import { C } from './chunk-ANPNT6PM.js';
8
- import { resolveGitCommonDir, defaultGitRunner } from './chunk-O6DYCIVW.js';
8
+ import { resolveGitCommonDir, defaultGitRunner } from './chunk-QOUR4CQ7.js';
9
9
  import { loadTemplateFiles, loadMaintainedFiles, skillDir, AGENTS_SKILLS_BASE } from './chunk-ZQSANKS4.js';
10
10
  import { cliInvocation } from './chunk-CRB3POP4.js';
11
11
  import { linkedAgentsPath } from './chunk-DQ6YO7FH.js';
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
4
- import { autoConnect } from './chunk-6NUPXDAA.js';
5
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
4
+ import { autoConnect } from './chunk-3M6UYJSR.js';
5
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
6
6
  import { C } from './chunk-ANPNT6PM.js';
7
- import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
7
+ import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-TVGLNHEB.js';
8
8
  import { parseWorkItemEnv } from './chunk-T2Q7ISPE.js';
9
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
10
10
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -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-WIK5KUGK.js';
4
+ import { CaptureDaemon } from './chunk-AJYZNISW.js';
5
+ import { spoolDir } from './chunk-CXQCBAKO.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';
@@ -2,11 +2,11 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-6NUPXDAA.js';
5
+ import { autoConnect } from './chunk-3M6UYJSR.js';
6
6
  import { acquireSpoolLockAt } from './chunk-MECW77XP.js';
7
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
7
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
8
8
  import { C } from './chunk-ANPNT6PM.js';
9
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
9
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-TVGLNHEB.js';
10
10
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
12
  import { StepNameSchema, StepBodySchema } from './chunk-EOTMDIYC.js';
@@ -2,10 +2,10 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { RecipeError } from './chunk-3Z3MPR55.js';
4
4
  import { BUILDKIT_IMAGE } from './chunk-ES4ULBAL.js';
5
- import { compareVersions } from './chunk-6ZFY2L2T.js';
6
- import { ensureHostKey } from './chunk-SOI6K5DY.js';
7
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-PA6CK6WQ.js';
8
- import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-BALIE3BA.js';
5
+ import { compareVersions } from './chunk-AJYZNISW.js';
6
+ import { ensureHostKey } from './chunk-XLJLR7EK.js';
7
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, runnerDir, jobsDir } from './chunk-N7LAEN3T.js';
8
+ import { CLAUDE_PORT, JOB_MOUNT, GATEWAY_PORT, GATEWAY_SOCKET, CLAUDE_SOCKET, RELAY_PORT, DESTINATION_BASE_PORT } from './chunk-YOBQIXX6.js';
9
9
  import { JOIN_DIR, RELAY_ID, JOIN_SOCKET, TARGET_GATEWAY, TARGET_CLAUDE, destinationTarget, RELAY_USER } from './chunk-MESOOLF4.js';
10
10
  import { createHash } from 'crypto';
11
11
  import { existsSync, mkdirSync, createWriteStream, rmSync, readFileSync, chmodSync, writeFileSync, realpathSync, readdirSync, renameSync } from 'fs';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILD_HOME } from './chunk-BALIE3BA.js';
3
+ import { BUILD_HOME } from './chunk-YOBQIXX6.js';
4
4
  import { join, dirname } from 'path';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -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-N7LAEN3T.js';
4
4
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { readNewestDemo } from './chunk-ER6KQCVJ.js';
4
- import { runEmitArtifact } from './chunk-5HZGLLNW.js';
4
+ import { runEmitArtifact } from './chunk-E34FRRSW.js';
5
5
  import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
6
6
  import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-ES4ULBAL.js';
7
7
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
8
- import { autoConnect } from './chunk-6NUPXDAA.js';
9
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
8
+ import { autoConnect } from './chunk-3M6UYJSR.js';
9
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
10
10
  import { C } from './chunk-ANPNT6PM.js';
11
- import { defaultFetch, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
11
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-TVGLNHEB.js';
12
12
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
13
13
  import { ARTIFACT_MAX_BYTES, ARTIFACT_MAX_CAPTION_LENGTH, DEMO_RECORD_MEDIA_TYPE, ARTIFACT_MAX_REPLACES_TARGETS, DemoManifestSchema, ARTIFACT_KINDS } from './chunk-EOTMDIYC.js';
14
14
  import { homeFromEnv } from './chunk-VNVZDWO3.js';
@@ -4,6 +4,6 @@ import { createRequire } from 'node:module';
4
4
  createRequire(import.meta.url);
5
5
 
6
6
  // src/runner/protocol.ts
7
- var RUNNER_PROTOCOL = 31;
7
+ var RUNNER_PROTOCOL = 32;
8
8
 
9
9
  export { RUNNER_PROTOCOL };
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { sha256OfFile, downloadPinned, VoiceDownloadError } from './chunk-2PGI6RDE.js';
4
- import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-2JB4GD34.js';
5
- import { readDefaultBranchHead, cloneRepository, buildRepositoryImage, prepareImageBuild, KEY_PREFIX, FETCHED_DIR, toolsDockerfile, TAG_HOST, metadataFromLabels, writeRecord, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_VOICE_DIR } from './chunk-ZVLSYWDF.js';
4
+ import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-EZ7L5IZU.js';
5
+ import { readDefaultBranchHead, cloneRepository, buildRepositoryImage, prepareImageBuild, KEY_PREFIX, FETCHED_DIR, toolsDockerfile, TAG_HOST, metadataFromLabels, writeRecord, FETCHED_FFMPEG, FETCHED_GH, FETCHED_TINI, FETCHED_VOICE_DIR } from './chunk-3NFZN7H6.js';
6
6
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
7
7
  import { currentCliBuild } from './chunk-OGFGZQA3.js';
8
- import { runExec, execCapture, waitForAgent } from './chunk-5THSC6BD.js';
9
- import { GUEST_CID, linkVsockSockets } from './chunk-L26V6ILJ.js';
10
- import { describeCallFailure, keepStagedContext, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, prefetchGovernedContext, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript, WORKFLOW_PERMISSION_REASON } from './chunk-62LXQM7U.js';
11
- import { runnerImageVersion } from './chunk-MZBQTVFG.js';
12
- import { runnerCredentialProblem, builtinKind, hostAllowed } from './chunk-3CKMB2UK.js';
13
- import { formatBytes, allocatedBytes } from './chunk-ZYKFYNES.js';
14
- import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, readDu, JUDGE_DIR, MAX_ITEMS_BYTES, JUDGE_ITEMS, MAX_REPORT_BYTES, JUDGE_REPORT, spawnRun } from './chunk-43I7PXDP.js';
8
+ import { runExec, execCapture, waitForAgent } from './chunk-IHY457PB.js';
9
+ import { GUEST_CID, linkVsockSockets } from './chunk-2RBIW2PD.js';
10
+ import { retrySend, describeCallFailure, keepStagedContext, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, prefetchGovernedContext, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript, WORKFLOW_PERMISSION_REASON } from './chunk-AVLLJW5D.js';
11
+ import { runnerImageVersion } from './chunk-36T6W5RA.js';
12
+ import { runnerCredentialProblem, builtinKind, hostAllowed } from './chunk-4XYC2663.js';
13
+ import { formatBytes, allocatedBytes } from './chunk-UC2DKBMS.js';
14
+ import { createDockerHost, builderSpec, runnerLabelValue, RUNNER_LABEL, BUILD_LABEL, prepareRunArgs, containerRunArgs, HASH_ARGV, parseProgramHash, JUDGE_PROGRAM, containerExecArgs, childEnvironment, readDu, JUDGE_DIR, MAX_ITEMS_BYTES, JUDGE_ITEMS, MAX_REPORT_BYTES, JUDGE_REPORT, spawnRun } from './chunk-MPDLZCXM.js';
15
15
  import { RecipeError, DOCKER_FEATURE, writeSanitizedRecipe, classifyProperties } from './chunk-3Z3MPR55.js';
16
16
  import { firecrackerArch, MICROVM_ARCHES, FIRECRACKER_VERSION, hostHelperPinned, CLAUDE_CODE_VERSION, guestAssetsPinned, GUEST_HELPER_SHA256, GUEST_ASSETS_BASE_URL, GUEST_KERNEL_SHA256, JAILER_BINARY_SHA256, FIRECRACKER_BINARY_SHA256, FIRECRACKER_SHA256, GUEST_ASSETS_VERSION, BUILDER_DISK_VERSION, builderDiskPinned, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, GH_VERSION, TINI_SHA256, TINI_VERSION, VOICE_PACK_FILES, BUILDER_DISK_SHA256, BUILDER_DISK_BASE_URL, DEFAULT_BASE_IMAGE } from './chunk-ES4ULBAL.js';
17
- import { WorkCommandError, getJson } from './chunk-Z4KWHSO4.js';
17
+ import { postJson, WorkCommandError, getJson } from './chunk-IW6Z337K.js';
18
18
  import { sanitizeTerminal } from './chunk-MECW77XP.js';
19
- import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-6ZFY2L2T.js';
20
- import { signerFor } from './chunk-SOI6K5DY.js';
21
- import { vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, buildsDir, buildDir, runnerDir, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, SHIM_DIR, vsockPath, builderCacheDiskPath, builderConsolePath } from './chunk-PA6CK6WQ.js';
22
- import { parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, claudeCredential, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, buildEnvironment, writeBuildMavenSettings, checkEnvironment, AGENT_CREDENTIAL_MISSING, mavenSettingsXml, namesGlobalSettings, MAVEN_NO_PROXY_NOTE, mavenArgs, MAVEN_SPACE_NOTE, writeMavenSettings, checkoutPath, JOB_MOUNT } from './chunk-BALIE3BA.js';
19
+ import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-AJYZNISW.js';
20
+ import { signerFor } from './chunk-XLJLR7EK.js';
21
+ import { vmAssetsDir, RUNNER_DIR_MODE, rootfsPathFor, diskTemplatesDir, RUNNER_FILE_MODE, buildsDir, buildDir, runnerDir, deliveryDir, ghConfigDir, runnerDirOfBuild, spoolDir, mirrorDir, SHIM_DIR, vsockPath, builderCacheDiskPath, builderConsolePath } from './chunk-N7LAEN3T.js';
22
+ import { claudeCredential, parseIsolation, proxyEnvironment, withProxyWarningHidden, containerLocalAddress, destinationEnvironment, CLAUDE_CREDENTIAL_VARIABLES, builtInEnvironment, withHooksPath, startBuildServices, BUILT_IN_NAMES, repositoriesOf, primaryOf, RELAY_PORT, repositoryPath, CHECKOUT_DIR, lifecycleWorkdir, buildEnvironment, writeBuildMavenSettings, checkEnvironment, AGENT_CREDENTIAL_MISSING, mavenSettingsXml, namesGlobalSettings, MAVEN_NO_PROXY_NOTE, mavenArgs, MAVEN_SPACE_NOTE, writeMavenSettings, checkoutPath, JOB_MOUNT } from './chunk-YOBQIXX6.js';
23
23
  import { sharedSkillNames, skillConflictMessage } from './chunk-FGF52V4V.js';
24
24
  import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
25
25
  import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-FGXT5OXS.js';
@@ -41,6 +41,41 @@ import { pipeline, finished } from 'stream/promises';
41
41
  import { createGunzip, gunzipSync, constants as constants$1 } from 'zlib';
42
42
 
43
43
  createRequire(import.meta.url);
44
+
45
+ // src/runner/managed-claude-key.ts
46
+ var FETCH_RETRY_WINDOW_MS = 3e4;
47
+ var ADOPTED_FETCH_RETRY_WINDOW_MS = 3e5;
48
+ async function fetchManagedClaudeKey(config, item, deps = {}) {
49
+ const fetchImpl = deps.fetchImpl ?? fetch;
50
+ const outcome = await retrySend(
51
+ async () => postJson(config.url, `/v1/work-items/${item}/claim/anthropic-key`, config.apiKey, config.appId, {}, fetchImpl, void 0, await signerFor(config.configPath)),
52
+ { now: deps.now, sleep: deps.sleep, windowMs: deps.windowMs ?? FETCH_RETRY_WINDOW_MS }
53
+ );
54
+ if (!outcome.ok) return { ok: false, code: outcome.code, reason: outcome.message ?? outcome.reason, retryable: outcome.retryable };
55
+ const apiKey = outcome.value.data.apiKey;
56
+ if (typeof apiKey !== "string" || apiKey === "") {
57
+ return { ok: false, code: "malformed_key_response", reason: "the gateway's answer carried no Anthropic key", retryable: false };
58
+ }
59
+ return { ok: true, apiKey };
60
+ }
61
+ var held = /* @__PURE__ */ new Map();
62
+ var everHeld = /* @__PURE__ */ new Set();
63
+ function holdManagedClaudeKey(jobDir, apiKey) {
64
+ held.set(jobDir, apiKey);
65
+ everHeld.add(apiKey);
66
+ }
67
+ function managedClaudeKeyFor(jobDir) {
68
+ return held.get(jobDir);
69
+ }
70
+ function dropManagedClaudeKey(jobDir) {
71
+ held.delete(jobDir);
72
+ }
73
+ function managedClaudeKeyValues() {
74
+ return [...everHeld];
75
+ }
76
+ function hasClaudeCredential(config, hostEnv, jobDir) {
77
+ return config.managed === true ? managedClaudeKeyFor(jobDir) !== void 0 : claudeCredential(hostEnv) !== void 0;
78
+ }
44
79
  var AssetError = class extends Error {
45
80
  constructor(file, message) {
46
81
  super(message);
@@ -2454,8 +2489,8 @@ function claudeCredentialCheck(env, options = {}) {
2454
2489
  }
2455
2490
  return { name, status: "pass", detail: `${variables[0]} is set in the claude.env or runner.env of the service ${unit}` };
2456
2491
  }
2457
- const held = claudeCredential(env, { ignoreHeld: options.ignoreHeld === true });
2458
- if (held === void 0) {
2492
+ const held2 = claudeCredential(env, { ignoreHeld: options.ignoreHeld === true });
2493
+ if (held2 === void 0) {
2459
2494
  return {
2460
2495
  name,
2461
2496
  status: "fail",
@@ -2464,7 +2499,7 @@ function claudeCredentialCheck(env, options = {}) {
2464
2499
  };
2465
2500
  }
2466
2501
  const sameVariables = options.shell === true ? "; the runner must be started with the same variable" : "";
2467
- return { name, status: "pass", detail: `${held.variable} is set${sameVariables}` };
2502
+ return { name, status: "pass", detail: `${held2.variable} is set${sameVariables}` };
2468
2503
  }
2469
2504
  function missingPermissionOf(err) {
2470
2505
  if (!(err instanceof WorkCommandError) || err.status !== 403) return void 0;
@@ -2762,10 +2797,10 @@ async function runBuildSteps(input) {
2762
2797
  if (staged.kind === "refused") return { ok: false, reason: staged.reason };
2763
2798
  let controlPlane;
2764
2799
  if (input.requireBuildSkill === true && !(staged.kind === "staged" && stagedHasBuildSkill(staged))) {
2765
- const held = await checkoutHasBuildSkill(input);
2766
- if (held !== true) {
2800
+ const held2 = await checkoutHasBuildSkill(input);
2801
+ if (held2 !== true) {
2767
2802
  if (staged.kind === "staged") input.removeStagedContext();
2768
- if (held !== false) return { ok: false, reason: held.failed };
2803
+ if (held2 !== false) return { ok: false, reason: held2.failed };
2769
2804
  return { ok: false, reason: missingBuildSkillReason(staged.kind === "staged" ? { repository: staged.repository, commit: staged.sha } : void 0) };
2770
2805
  }
2771
2806
  }
@@ -3629,17 +3664,17 @@ async function drain(req) {
3629
3664
  }
3630
3665
  function readPrefix(req, gzip) {
3631
3666
  return new Promise((resolve2, reject) => {
3632
- const held = [];
3667
+ const held2 = [];
3633
3668
  const finish = (section) => {
3634
3669
  req.off("data", onData);
3635
3670
  req.off("end", onEnd);
3636
3671
  req.off("error", reject);
3637
3672
  req.pause();
3638
- resolve2({ held, section });
3673
+ resolve2({ held: held2, section });
3639
3674
  };
3640
3675
  const onData = (chunk) => {
3641
- held.push(chunk);
3642
- const section = readCommandSection(Buffer.concat(held), gzip);
3676
+ held2.push(chunk);
3677
+ const section = readCommandSection(Buffer.concat(held2), gzip);
3643
3678
  if (section.kind !== "need-more") finish(section);
3644
3679
  };
3645
3680
  const onEnd = () => finish({ kind: "need-more" });
@@ -3727,7 +3762,7 @@ function createGitRemote(options) {
3727
3762
  async function push(req, res, route, target) {
3728
3763
  const encoding = req.headers["content-encoding"];
3729
3764
  const gzip = encoding === "gzip";
3730
- const { held, section } = await readPrefix(req, gzip);
3765
+ const { held: held2, section } = await readPrefix(req, gzip);
3731
3766
  const refuse = async (reason) => {
3732
3767
  log(`push refused: ${reason}`);
3733
3768
  await drain(req);
@@ -3757,7 +3792,7 @@ function createGitRemote(options) {
3757
3792
  const file = createWriteStream(bodyPath);
3758
3793
  const cap = options.maxPushBytes ?? 2 * 1024 ** 3;
3759
3794
  let size = 0;
3760
- for (const chunk of held) {
3795
+ for (const chunk of held2) {
3761
3796
  size += chunk.length;
3762
3797
  file.write(chunk);
3763
3798
  }
@@ -3803,7 +3838,7 @@ function createGitRemote(options) {
3803
3838
  createReadStream(spooled).pipe(upstream);
3804
3839
  return;
3805
3840
  }
3806
- for (const chunk of held) upstream.write(chunk);
3841
+ for (const chunk of held2) upstream.write(chunk);
3807
3842
  req.pipe(upstream);
3808
3843
  }
3809
3844
  });
@@ -3914,27 +3949,27 @@ function usableCpus(deps = {}) {
3914
3949
  }
3915
3950
  function createCpuAllocator(cores) {
3916
3951
  const usable = [...new Set(cores)].sort((a, b) => a - b);
3917
- const held = /* @__PURE__ */ new Map();
3952
+ const held2 = /* @__PURE__ */ new Map();
3918
3953
  const holders = (core) => {
3919
3954
  let count = 0;
3920
- for (const set of held.values()) if (set.includes(core)) count++;
3955
+ for (const set of held2.values()) if (set.includes(core)) count++;
3921
3956
  return count;
3922
3957
  };
3923
3958
  return {
3924
3959
  acquire(buildId, cpus) {
3925
- const existing = held.get(buildId);
3960
+ const existing = held2.get(buildId);
3926
3961
  if (existing !== void 0) return existing;
3927
3962
  const wanted = Math.min(Math.ceil(cpus), usable.length);
3928
3963
  const ranked = usable.map((core) => ({ core, count: holders(core) })).sort((a, b) => a.count - b.count);
3929
3964
  const chosen = ranked.slice(0, wanted).map(({ core }) => core).sort((a, b) => a - b);
3930
- held.set(buildId, chosen);
3965
+ held2.set(buildId, chosen);
3931
3966
  return chosen;
3932
3967
  },
3933
3968
  hold(buildId, set) {
3934
- held.set(buildId, [...set]);
3969
+ held2.set(buildId, [...set]);
3935
3970
  },
3936
3971
  release(buildId) {
3937
- held.delete(buildId);
3972
+ held2.delete(buildId);
3938
3973
  }
3939
3974
  };
3940
3975
  }
@@ -4189,7 +4224,7 @@ async function provisionContainer(input) {
4189
4224
  const tag = `#${item.number}`;
4190
4225
  const logPath = join(jobDir, "provision.log");
4191
4226
  const fail = (reason) => ({ ok: false, reason });
4192
- if (claudeCredential(runtime.hostEnv) === void 0) return fail(AGENT_CREDENTIAL_MISSING);
4227
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
4193
4228
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
4194
4229
  const primary = primaryOf(repositories);
4195
4230
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -4541,7 +4576,7 @@ async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, bui
4541
4576
  ...lease === void 0 ? {} : { lease },
4542
4577
  ...inherit === void 0 ? {} : { inherit },
4543
4578
  ...routeLog === void 0 ? {} : { log: routeLog },
4544
- ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream } } : {},
4579
+ ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream, claudeApiKey: managedClaudeKeyFor(jobDir) } } : {},
4545
4580
  hostEnv: runtime.hostEnv,
4546
4581
  destinationOptions: runtime.destinationOptions
4547
4582
  });
@@ -4964,4 +4999,4 @@ function describeMachineDocker(machine) {
4964
4999
  return `Docker Engine ${version ?? "of no known version"}, older than the ${MIN_ENGINE_MAJOR} that container builds need`;
4965
5000
  }
4966
5001
 
4967
- export { ADDED_USER, AgentUserError, AssetError, DeliveryFailure, EVAL_INPUT_NAME, GH_CONFIG_YML, HELPER_ENV, LEASE_SECONDS, MANAGED_UNJAILED_REASON, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, ROOT_DISK_ID_PREFIX, RunnerInitError, attemptNote, claimPermissionProblem, claudeCredentialCheck, cleanupContainer, closeHostBuild, containerCommandExec, containerJudgeEnvironment, containerSenderCommand, copyJudgeTree, copyTranscripts, copyTranscriptsFromContainer, createBuildDisk, createContainerRuntime, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deleteBuildDisk, deliverContainerHooks, deliverExecMaven, describeMachineDocker, detectMachine, ensureFirecrackerAndJailer, ensureRootfs, ensureTunnel, execArgv, execCommandLine, filesAreCopied, formerSkillProblem, formerSkillQueues, ghHostsYml, gitRemoteFor, helperFirecrackerNote, helperSocketPath, hostCommandEnvironment, hostEnvironment, isPlaceholderCommand, keepGhConfigCurrent, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listenOnBroker, machineConfig, makeBuildsDirPrivate, measureDisk, microVmArchSupported, microVmAssetsPinned, missingPermissionFix, missingPermissionOf, needsBuildSkill, needsClaudeCredential, obtainImage, outOfMemoryReason, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareRunnerInit, probeHelper, provisionContainer, provisionEnvironment, reachDockerStep, readConfigObject, resolveAgentUser, resolveHostBuild, runBuildSteps, runRunnerInit, runWithSpawn, senderAliveScript, senderSignalScript, setUpRunnerCgroup, shellQuote, signalInContainer, startCheckContainer, startHostServices, startJailedInto, startServicesFor, stopContainer, stopJailed, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, syncInContainer, withTunnelLog, writeEvalInput, writeRunnerInit };
5002
+ export { ADDED_USER, ADOPTED_FETCH_RETRY_WINDOW_MS, AgentUserError, AssetError, DeliveryFailure, EVAL_INPUT_NAME, GH_CONFIG_YML, HELPER_ENV, LEASE_SECONDS, MANAGED_UNJAILED_REASON, MIN_ENGINE_MAJOR, PLACEHOLDER_MARKER, ROOT_DISK_ID_PREFIX, RunnerInitError, attemptNote, claimPermissionProblem, claudeCredentialCheck, cleanupContainer, closeHostBuild, containerCommandExec, containerJudgeEnvironment, containerSenderCommand, copyJudgeTree, copyTranscripts, copyTranscriptsFromContainer, createBuildDisk, createContainerRuntime, createLeaseChannel, currentSkillCommand, decideHostBuildSkill, deleteBuildDisk, deliverContainerHooks, deliverExecMaven, describeMachineDocker, detectMachine, dropManagedClaudeKey, ensureFirecrackerAndJailer, ensureRootfs, ensureTunnel, execArgv, execCommandLine, fetchManagedClaudeKey, filesAreCopied, formerSkillProblem, formerSkillQueues, ghHostsYml, gitRemoteFor, hasClaudeCredential, helperFirecrackerNote, helperSocketPath, holdManagedClaudeKey, hostCommandEnvironment, hostEnvironment, isPlaceholderCommand, keepGhConfigCurrent, leaseExpiresAtMs, leaseTimeLeftMs, lifecycleFailureReason, lifecycleSteps, listenOnBroker, machineConfig, makeBuildsDirPrivate, managedClaudeKeyFor, managedClaudeKeyValues, measureDisk, microVmArchSupported, microVmAssetsPinned, missingPermissionFix, missingPermissionOf, needsBuildSkill, needsClaudeCredential, obtainImage, outOfMemoryReason, parseCpuList, permissionModeProblem, permissionModeProblems, placeholderProblem, placeholderQueues, prepareBranch, prepareRunnerInit, probeHelper, provisionContainer, provisionEnvironment, reachDockerStep, readConfigObject, resolveAgentUser, resolveHostBuild, runBuildSteps, runRunnerInit, runWithSpawn, senderAliveScript, senderSignalScript, setUpRunnerCgroup, shellQuote, signalInContainer, startCheckContainer, startHostServices, startJailedInto, startServicesFor, stopContainer, stopJailed, supportsContainerBuilds, supportsMicroVmBuilds, sweepImageBuilders, syncInContainer, withTunnelLog, writeEvalInput, writeRunnerInit };
@@ -2,10 +2,10 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
4
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-6NUPXDAA.js';
6
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
5
+ import { autoConnect } from './chunk-3M6UYJSR.js';
6
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
7
7
  import { C } from './chunk-ANPNT6PM.js';
8
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
8
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-TVGLNHEB.js';
9
9
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
11
  import { CriteriaListSchema } from './chunk-EOTMDIYC.js';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { removeRetiredSkills } from './chunk-JWNH4ZTF.js';
4
- import { defaultFetch, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
5
- import { withTokenHeader } from './chunk-BALIE3BA.js';
4
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-TVGLNHEB.js';
5
+ import { withTokenHeader } from './chunk-YOBQIXX6.js';
6
6
  import { appendContextProvenance } from './chunk-ZJSNLVCE.js';
7
7
  import { loadMaintainedFiles, writeMaintainedFiles } from './chunk-ZQSANKS4.js';
8
8
  import { cliInvocation } from './chunk-CRB3POP4.js';
@@ -1,28 +1,28 @@
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-HAEDLXHA.js';
5
+ import { writeDockerClientConfig } from './chunk-75KZUBHD.js';
6
6
  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';
7
+ import { senderPidfile } from './chunk-KDLQGTN6.js';
8
+ import { installScrubContext } from './chunk-WIK5KUGK.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-POGPX7LI.js';
10
+ import { readBranchHead, fetchCommit, diffBetween } from './chunk-3NFZN7H6.js';
11
11
  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';
12
+ import { waitForAgent, vmExecArgs } from './chunk-IHY457PB.js';
13
+ import { socketPathProblem, vsockLinks, LEASE_LINK, linkVsockSockets } from './chunk-2RBIW2PD.js';
14
+ import { describeCallFailure, resolveGoverningSource, prefetchGovernedContext, refusalCode, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, logStamp, createRunnerLog, removeKeptContext, formatDuration, retrySend, formatClock, WORKFLOW_PERMISSION_REASON, keptContextTree } from './chunk-AVLLJW5D.js';
15
+ import { imageBuildOf, isBuiltinContainer, isBuiltinProcess, isBuiltinVm, DEFAULT_CHECK_TIME_LIMIT_MINUTES } from './chunk-4XYC2663.js';
16
+ import { DEFAULT_CACHE_DISK, formatBytes, allocatedBytes } from './chunk-UC2DKBMS.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-MPDLZCXM.js';
18
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-IW6Z337K.js';
20
20
  import { planArtifactUpload } from './chunk-MECW77XP.js';
21
- import { scrubText } from './chunk-6ZFY2L2T.js';
21
+ import { scrubText } from './chunk-AJYZNISW.js';
22
22
  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';
23
+ import { signerFor } from './chunk-XLJLR7EK.js';
24
+ import { RUNNER_FILE_MODE, runnerDir, buildDir, vsockPath, jobConsolePath } from './chunk-N7LAEN3T.js';
25
+ import { JOB_MOUNT, repositoriesOf, primaryOf, buildEnvironment, CHECKOUT_DIR, claudeCredential, AGENT_CREDENTIAL_MISSING, sharedUserEnvironment, headerVariables, authorEnvironment, withTunnelRecord, commitIdentityRecord, buildMavenSettingsXml, CLAUDE_CREDENTIAL_VARIABLES, currentClaudeCredential, removedClaudeCredentialValues, managedClaudeCredential, RELAY_PORT, repositoryPath, lifecycleWorkdir, CHECK_ITEMS_FILE, MAVEN_SETTINGS_FILE, checkEnvironment, EVAL_INPUT_DIR } from './chunk-YOBQIXX6.js';
26
26
  import { resolvePackRoot } from './chunk-ZQSANKS4.js';
27
27
  import { MAINTAINED_SKILLS } from './chunk-CDDED64E.js';
28
28
  import { resolveVersion } from './chunk-RA3O54FC.js';
@@ -297,7 +297,7 @@ async function provisionMicroVm(input) {
297
297
  const tag = `#${item.number}`;
298
298
  const logPath = join(jobDir, "provision.log");
299
299
  const fail = (reason) => ({ ok: false, reason });
300
- if (claudeCredential(runtime.hostEnv) === void 0) return fail(AGENT_CREDENTIAL_MISSING);
300
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
301
301
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
302
302
  const primary = primaryOf(repositories);
303
303
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -2238,7 +2238,7 @@ async function runJudge(input) {
2238
2238
  const brief = check.judge.text;
2239
2239
  if (brief === void 0) return await fail(check, `the brief ${check.judge.brief} is not in the definitions repository`);
2240
2240
  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);
2241
+ const credential = config.managed === true && managedClaudeKeyFor(jobDir) !== void 0 ? managedClaudeCredential() : claudeCredential(runtime.hostEnv);
2242
2242
  if (credential === void 0) return await fail(check, "the host holds no Claude credential for the judge");
2243
2243
  const branch = job.branch;
2244
2244
  if (branch === void 0) return await fail(check, "the build pushed no branch: the claim names none");
@@ -2635,7 +2635,7 @@ function mergeScrubConfig(a, b) {
2635
2635
  function releaseScrub(config, home) {
2636
2636
  const merged = mergeScrubConfig(config.scrub, readCloudConfig(home).scrub);
2637
2637
  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);
2638
+ const held = [currentClaudeCredential(process.env)?.value, ...removedClaudeCredentialValues(), ...managedClaudeKeyValues()].filter((value) => value !== void 0);
2639
2639
  return { literals: [...scrubList(merged?.literals), ...secrets, ...held], patterns: scrubList(merged?.patterns) };
2640
2640
  }
2641
2641
  function transcriptScrub(config, secrets) {
@@ -3222,6 +3222,7 @@ async function finishJob(job, jobDirPath, outcome, config, deps, ending) {
3222
3222
  await held.revokeAll();
3223
3223
  deps.container.credentials.delete(jobDirPath);
3224
3224
  }
3225
+ dropManagedClaudeKey(jobDirPath);
3225
3226
  if (outcome !== void 0) {
3226
3227
  const fromHook = readReasonLine(jobDirPath, config);
3227
3228
  if (verdictReason !== void 0) {
@@ -1,12 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { placeholderQueues, placeholderProblem } from './chunk-YEVPRO7L.js';
4
- import { checkFit } from './chunk-AMEM2ZLL.js';
5
- import { builtinKind, imageBuildOf } from './chunk-3CKMB2UK.js';
6
- import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-ZYKFYNES.js';
3
+ import { placeholderQueues, placeholderProblem } from './chunk-POGPX7LI.js';
4
+ import { checkFit } from './chunk-AABYHGVO.js';
5
+ import { builtinKind, imageBuildOf } from './chunk-4XYC2663.js';
6
+ import { realBuildDiskProbe, checkDiskFit, DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-UC2DKBMS.js';
7
7
  import { builderDiskPinned } from './chunk-ES4ULBAL.js';
8
- import { claudeCredentialVariablesSet, claudeCredential } from './chunk-BALIE3BA.js';
9
- import { closeSync, openSync, constants } from 'fs';
8
+ import { FORWARDED_CLAUDE_CREDENTIAL_VARIABLES, claudeCredentialVariablesSet, claudeCredential, claudeEnvPath } from './chunk-YOBQIXX6.js';
9
+ import { parseRunnerEnv } from './chunk-HACGUL52.js';
10
+ import { closeSync, openSync, constants, readFileSync } from 'fs';
11
+ import { join, dirname } from 'path';
10
12
  import { totalmem } from 'os';
11
13
 
12
14
  createRequire(import.meta.url);
@@ -38,15 +40,11 @@ function managedProblems(facts) {
38
40
  const advice = problem.includes("pins no helper") || problem.includes("runner install") ? "" : ". Run `outerlayer runner install --service --replace` to install the root helper, then restart the service";
39
41
  problems.push({ condition: "jailer", reason: `builds would run without the jailer, which a managed runner does not allow: ${problem}${advice}` });
40
42
  }
41
- if (facts.credentials.has("CLAUDE_CODE_OAUTH_TOKEN")) {
43
+ const held = FORWARDED_CLAUDE_CREDENTIAL_VARIABLES.filter((variable) => facts.credentials.has(variable));
44
+ if (held.length > 0) {
42
45
  problems.push({
43
46
  condition: "credential",
44
- reason: "CLAUDE_CODE_OAUTH_TOKEN is set in the runner's environment or credentials directory, and a managed runner accepts only ANTHROPIC_API_KEY. Remove CLAUDE_CODE_OAUTH_TOKEN from the claude.env and runner.env beside the config, store ANTHROPIC_API_KEY, then restart the service"
45
- });
46
- } else if (!facts.credentials.has("ANTHROPIC_API_KEY")) {
47
- problems.push({
48
- condition: "credential",
49
- reason: "there is no Claude credential in the runner's environment, and a managed runner needs ANTHROPIC_API_KEY. Store ANTHROPIC_API_KEY with `outerlayer runner init --agent claude`, which writes the claude.env beside the config, then restart the service"
47
+ reason: `a managed runner holds no Claude credential of its own: it gets the factory's Anthropic API key from each claim. ${held.join(" and ")} ${held.length === 1 ? "is" : "are"} set in the runner's environment, runner.env or claude.env. Remove ${held.length === 1 ? "it" : "them"} from the environment and from the runner.env and claude.env beside the config, then restart the service`
50
48
  });
51
49
  }
52
50
  if (facts.allowHosts === void 0) {
@@ -70,11 +68,26 @@ function managedProblems(facts) {
70
68
  }
71
69
  return problems;
72
70
  }
71
+ function credentialsInFiles(configPath) {
72
+ const found = /* @__PURE__ */ new Set();
73
+ if (configPath === void 0) return found;
74
+ for (const path of [join(dirname(configPath), "runner.env"), claudeEnvPath(configPath)]) {
75
+ let text;
76
+ try {
77
+ text = readFileSync(path, "utf8");
78
+ } catch {
79
+ continue;
80
+ }
81
+ const values = parseRunnerEnv(text);
82
+ for (const variable of FORWARDED_CLAUDE_CREDENTIAL_VARIABLES) if ((values[variable] ?? "").trim() !== "") found.add(variable);
83
+ }
84
+ return found;
85
+ }
73
86
  function managedFactsOf(config, probes) {
74
87
  return {
75
88
  provision: config.hooks.provision,
76
89
  jailer: probes.jailer ?? "unknown",
77
- credentials: claudeCredentialVariablesSet(probes.env),
90
+ credentials: /* @__PURE__ */ new Set([...claudeCredentialVariablesSet(probes.env), ...credentialsInFiles(config.configPath)]),
78
91
  allowHosts: config.build?.allowHosts,
79
92
  imageBuild: imageBuildOf(config),
80
93
  builderDiskPinned: probes.builderDiskPinned ?? builderDiskPinned()
@@ -132,7 +145,7 @@ function checkBlockedWithSlots(config, probes) {
132
145
  }
133
146
  if (builder !== "usable") return { blocked: { reason: `${builder.problem}. The runner takes work again once its image builder works` }, slots };
134
147
  }
135
- if (kind !== "own" && claudeCredential(probes.env) === void 0) {
148
+ if (kind !== "own" && config.managed !== true && claudeCredential(probes.env) === void 0) {
136
149
  return {
137
150
  slots,
138
151
  blocked: {
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-Z5IW4DHH.js';
4
- import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-NBZ7XBT6.js';
3
+ import { launcherPath, writeLauncher, LauncherWriteError, pathNotes } from './chunk-J246WRLZ.js';
4
+ import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-DUPM5LVJ.js';
5
5
  import { compareVersions } from './chunk-TQMI335S.js';
6
- import { RUNNER_DIR_MODE } from './chunk-PA6CK6WQ.js';
6
+ import { RUNNER_DIR_MODE } from './chunk-N7LAEN3T.js';
7
7
  import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
8
8
  import { dirname, sep, join } from 'path';
9
9