@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,30 +1,28 @@
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';
6
- import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
4
+ 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-UO4FQAOX.js';
7
5
  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';
15
- import { RecipeError, DOCKER_FEATURE, writeSanitizedRecipe, classifyProperties } from './chunk-3Z3MPR55.js';
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';
6
+ import { runExec, execCapture, waitForAgent } from './chunk-2ILU7UAU.js';
7
+ import { GUEST_CID, linkVsockSockets } from './chunk-OGPEHSNW.js';
8
+ import { retrySend, describeCallFailure, keepStagedContext, controlPlaneTokenFailure, refusalCode, resolveGoverningSource, prefetchGovernedContext, removeStagedContext, stageGovernedContext, pinnedSourceOf, commandWithShim, shimScript, WORKFLOW_PERMISSION_REASON } from './chunk-RFVIQLNB.js';
9
+ import { runnerImageVersion } from './chunk-SYVRBBLW.js';
10
+ import { hasStoredCredential, AGENT_COMMANDS, storeClaudeCredential, credentialFromStdin, isAgentName } from './chunk-OQLF3MQQ.js';
11
+ import { runnerCredentialProblem, builtinKind, hostAllowed } from './chunk-2D6CKNR7.js';
12
+ import { formatBytes, allocatedBytes } from './chunk-KM2HLQE3.js';
13
+ import { createDockerHost, builderSpec, RecipeError, DOCKER_FEATURE, 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, writeSanitizedRecipe, classifyProperties } from './chunk-5AFPP3GZ.js';
14
+ import { firecrackerArch, MICROVM_ARCHES, FIRECRACKER_VERSION, hostHelperPinned, CLAUDE_CODE_VERSION, builderDiskPinned, 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, 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-4UPET3R7.js';
15
+ import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
16
+ import { postJson, WorkCommandError, getJson } from './chunk-UN3SQTVL.js';
18
17
  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';
18
+ import { signerFor } from './chunk-MOI2KDLH.js';
23
19
  import { sharedSkillNames, skillConflictMessage } from './chunk-FGF52V4V.js';
24
20
  import { versionAtLeast, MINIMUM_CLAUDE_VERSION } from './chunk-HCVLP7XA.js';
21
+ import { setCustomScrubbers, setLocalIdentity, setRepoRoot, parseTranscript, scrubDeep, scrubText } from './chunk-AJYZNISW.js';
25
22
  import { orderSessions, extractFacts, sessionsToTimeline } from './chunk-FGXT5OXS.js';
26
23
  import { downconvertSession } from './chunk-EOTMDIYC.js';
27
- import { realFdStorePort } from './chunk-HACGUL52.js';
24
+ 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-PXGU3GKY.js';
25
+ 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, realFdStorePort } from './chunk-G4W4B33M.js';
28
26
  import { RELAY_USER, RELAY_ID, UNKNOWN_TRANSPORT_REASON, DOCKER_DESKTOP_REASON, MAX_MALFORMED_SESSIONS, MALFORMED_REASON, JOIN_WAIT_MS, MAX_OPEN_STREAMS, STREAM_RESET_RATE, STREAM_RESET_BURST, STREAM_WINDOW, SESSION_WINDOW, targetOfPath } from './chunk-MESOOLF4.js';
29
27
  import { spawn, spawnSync } from 'child_process';
30
28
  import { mkdirSync, existsSync, readFileSync, mkdtempSync, rmSync, chmodSync, truncateSync, statSync, accessSync, constants, readdirSync, writeFileSync, lstatSync, copyFileSync, renameSync, rmdirSync, unlinkSync, linkSync, openSync, closeSync, cpSync, writeSync, appendFileSync, createWriteStream, createReadStream } from 'fs';
@@ -41,6 +39,41 @@ import { pipeline, finished } from 'stream/promises';
41
39
  import { createGunzip, gunzipSync, constants as constants$1 } from 'zlib';
42
40
 
43
41
  createRequire(import.meta.url);
42
+
43
+ // src/runner/managed-claude-key.ts
44
+ var FETCH_RETRY_WINDOW_MS = 3e4;
45
+ var ADOPTED_FETCH_RETRY_WINDOW_MS = 3e5;
46
+ async function fetchManagedClaudeKey(config, item, deps = {}) {
47
+ const fetchImpl = deps.fetchImpl ?? fetch;
48
+ const outcome = await retrySend(
49
+ async () => postJson(config.url, `/v1/work-items/${item}/claim/anthropic-key`, config.apiKey, config.appId, {}, fetchImpl, void 0, await signerFor(config.configPath)),
50
+ { now: deps.now, sleep: deps.sleep, windowMs: deps.windowMs ?? FETCH_RETRY_WINDOW_MS }
51
+ );
52
+ if (!outcome.ok) return { ok: false, code: outcome.code, reason: outcome.message ?? outcome.reason, retryable: outcome.retryable };
53
+ const apiKey = outcome.value.data.apiKey;
54
+ if (typeof apiKey !== "string" || apiKey === "") {
55
+ return { ok: false, code: "malformed_key_response", reason: "the gateway's answer carried no Anthropic key", retryable: false };
56
+ }
57
+ return { ok: true, apiKey };
58
+ }
59
+ var held = /* @__PURE__ */ new Map();
60
+ var everHeld = /* @__PURE__ */ new Set();
61
+ function holdManagedClaudeKey(jobDir, apiKey) {
62
+ held.set(jobDir, apiKey);
63
+ everHeld.add(apiKey);
64
+ }
65
+ function managedClaudeKeyFor(jobDir) {
66
+ return held.get(jobDir);
67
+ }
68
+ function dropManagedClaudeKey(jobDir) {
69
+ held.delete(jobDir);
70
+ }
71
+ function managedClaudeKeyValues() {
72
+ return [...everHeld];
73
+ }
74
+ function hasClaudeCredential(config, hostEnv, jobDir) {
75
+ return config.managed === true ? managedClaudeKeyFor(jobDir) !== void 0 : claudeCredential(hostEnv) !== void 0;
76
+ }
44
77
  var AssetError = class extends Error {
45
78
  constructor(file, message) {
46
79
  super(message);
@@ -294,14 +327,6 @@ function converterScript(workDir = "/tmp/rootfs") {
294
327
  ...workDir === "/tmp/rootfs" ? [] : ['rm -rf "$rootfs"']
295
328
  ].join("\n");
296
329
  }
297
- function templateScript() {
298
- return [
299
- "set -eu",
300
- 'truncate -s "$BYTES" "/out/$OUT_NAME"',
301
- 'mke2fs -q -F -t ext4 -m 0 -E lazy_itable_init=1,lazy_journal_init=1,nodiscard "/out/$OUT_NAME"',
302
- 'chown "$HOST_UID:$HOST_GID" "/out/$OUT_NAME"'
303
- ].join("\n");
304
- }
305
330
  var ids = () => ({ uid: String(process.getuid?.() ?? 0), gid: String(process.getgid?.() ?? 0) });
306
331
  function converterArgs(dest, memoryBytes, extra, script) {
307
332
  const { uid, gid } = ids();
@@ -370,8 +395,11 @@ function createRootfsHost() {
370
395
  await spawnRun("docker", ["rm", "--force", "--volumes", container], { env: env() });
371
396
  }
372
397
  },
373
- async makeTemplate({ bytes, dest, memoryBytes }) {
374
- const made = await spawnRun("docker", converterArgs(dest, memoryBytes, ["-e", `BYTES=${bytes}`], templateScript()), { env: env() });
398
+ async makeTemplate({ bytes, dest }) {
399
+ writeFileSync(dest, "", { mode: RUNNER_FILE_MODE });
400
+ truncateSync(dest, bytes);
401
+ const path = [process.env.PATH, "/usr/sbin", "/sbin"].filter((entry) => entry !== void 0 && entry !== "").join(":");
402
+ const made = await spawnRun("mke2fs", ["-q", "-F", "-t", "ext4", "-m", "0", "-E", "lazy_itable_init=1,lazy_journal_init=1,nodiscard", dest], { env: { ...env(), PATH: path } });
375
403
  if (made.status !== 0) throw new Error(`making the empty build disk failed: ${firstLine(made.stderr)}`);
376
404
  },
377
405
  async imageConfig(imageId) {
@@ -2454,8 +2482,8 @@ function claudeCredentialCheck(env, options = {}) {
2454
2482
  }
2455
2483
  return { name, status: "pass", detail: `${variables[0]} is set in the claude.env or runner.env of the service ${unit}` };
2456
2484
  }
2457
- const held = claudeCredential(env, { ignoreHeld: options.ignoreHeld === true });
2458
- if (held === void 0) {
2485
+ const held2 = claudeCredential(env, { ignoreHeld: options.ignoreHeld === true });
2486
+ if (held2 === void 0) {
2459
2487
  return {
2460
2488
  name,
2461
2489
  status: "fail",
@@ -2464,7 +2492,7 @@ function claudeCredentialCheck(env, options = {}) {
2464
2492
  };
2465
2493
  }
2466
2494
  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}` };
2495
+ return { name, status: "pass", detail: `${held2.variable} is set${sameVariables}` };
2468
2496
  }
2469
2497
  function missingPermissionOf(err) {
2470
2498
  if (!(err instanceof WorkCommandError) || err.status !== 403) return void 0;
@@ -2762,10 +2790,10 @@ async function runBuildSteps(input) {
2762
2790
  if (staged.kind === "refused") return { ok: false, reason: staged.reason };
2763
2791
  let controlPlane;
2764
2792
  if (input.requireBuildSkill === true && !(staged.kind === "staged" && stagedHasBuildSkill(staged))) {
2765
- const held = await checkoutHasBuildSkill(input);
2766
- if (held !== true) {
2793
+ const held2 = await checkoutHasBuildSkill(input);
2794
+ if (held2 !== true) {
2767
2795
  if (staged.kind === "staged") input.removeStagedContext();
2768
- if (held !== false) return { ok: false, reason: held.failed };
2796
+ if (held2 !== false) return { ok: false, reason: held2.failed };
2769
2797
  return { ok: false, reason: missingBuildSkillReason(staged.kind === "staged" ? { repository: staged.repository, commit: staged.sha } : void 0) };
2770
2798
  }
2771
2799
  }
@@ -3629,17 +3657,17 @@ async function drain(req) {
3629
3657
  }
3630
3658
  function readPrefix(req, gzip) {
3631
3659
  return new Promise((resolve2, reject) => {
3632
- const held = [];
3660
+ const held2 = [];
3633
3661
  const finish = (section) => {
3634
3662
  req.off("data", onData);
3635
3663
  req.off("end", onEnd);
3636
3664
  req.off("error", reject);
3637
3665
  req.pause();
3638
- resolve2({ held, section });
3666
+ resolve2({ held: held2, section });
3639
3667
  };
3640
3668
  const onData = (chunk) => {
3641
- held.push(chunk);
3642
- const section = readCommandSection(Buffer.concat(held), gzip);
3669
+ held2.push(chunk);
3670
+ const section = readCommandSection(Buffer.concat(held2), gzip);
3643
3671
  if (section.kind !== "need-more") finish(section);
3644
3672
  };
3645
3673
  const onEnd = () => finish({ kind: "need-more" });
@@ -3727,7 +3755,7 @@ function createGitRemote(options) {
3727
3755
  async function push(req, res, route, target) {
3728
3756
  const encoding = req.headers["content-encoding"];
3729
3757
  const gzip = encoding === "gzip";
3730
- const { held, section } = await readPrefix(req, gzip);
3758
+ const { held: held2, section } = await readPrefix(req, gzip);
3731
3759
  const refuse = async (reason) => {
3732
3760
  log(`push refused: ${reason}`);
3733
3761
  await drain(req);
@@ -3757,7 +3785,7 @@ function createGitRemote(options) {
3757
3785
  const file = createWriteStream(bodyPath);
3758
3786
  const cap = options.maxPushBytes ?? 2 * 1024 ** 3;
3759
3787
  let size = 0;
3760
- for (const chunk of held) {
3788
+ for (const chunk of held2) {
3761
3789
  size += chunk.length;
3762
3790
  file.write(chunk);
3763
3791
  }
@@ -3803,7 +3831,7 @@ function createGitRemote(options) {
3803
3831
  createReadStream(spooled).pipe(upstream);
3804
3832
  return;
3805
3833
  }
3806
- for (const chunk of held) upstream.write(chunk);
3834
+ for (const chunk of held2) upstream.write(chunk);
3807
3835
  req.pipe(upstream);
3808
3836
  }
3809
3837
  });
@@ -3914,27 +3942,27 @@ function usableCpus(deps = {}) {
3914
3942
  }
3915
3943
  function createCpuAllocator(cores) {
3916
3944
  const usable = [...new Set(cores)].sort((a, b) => a - b);
3917
- const held = /* @__PURE__ */ new Map();
3945
+ const held2 = /* @__PURE__ */ new Map();
3918
3946
  const holders = (core) => {
3919
3947
  let count = 0;
3920
- for (const set of held.values()) if (set.includes(core)) count++;
3948
+ for (const set of held2.values()) if (set.includes(core)) count++;
3921
3949
  return count;
3922
3950
  };
3923
3951
  return {
3924
3952
  acquire(buildId, cpus) {
3925
- const existing = held.get(buildId);
3953
+ const existing = held2.get(buildId);
3926
3954
  if (existing !== void 0) return existing;
3927
3955
  const wanted = Math.min(Math.ceil(cpus), usable.length);
3928
3956
  const ranked = usable.map((core) => ({ core, count: holders(core) })).sort((a, b) => a.count - b.count);
3929
3957
  const chosen = ranked.slice(0, wanted).map(({ core }) => core).sort((a, b) => a - b);
3930
- held.set(buildId, chosen);
3958
+ held2.set(buildId, chosen);
3931
3959
  return chosen;
3932
3960
  },
3933
3961
  hold(buildId, set) {
3934
- held.set(buildId, [...set]);
3962
+ held2.set(buildId, [...set]);
3935
3963
  },
3936
3964
  release(buildId) {
3937
- held.delete(buildId);
3965
+ held2.delete(buildId);
3938
3966
  }
3939
3967
  };
3940
3968
  }
@@ -4189,7 +4217,7 @@ async function provisionContainer(input) {
4189
4217
  const tag = `#${item.number}`;
4190
4218
  const logPath = join(jobDir, "provision.log");
4191
4219
  const fail = (reason) => ({ ok: false, reason });
4192
- if (claudeCredential(runtime.hostEnv) === void 0) return fail(AGENT_CREDENTIAL_MISSING);
4220
+ if (!hasClaudeCredential(config, runtime.hostEnv, jobDir)) return fail(AGENT_CREDENTIAL_MISSING);
4193
4221
  const repositories = repositoriesOf({ repositories: input.repositories, repository: item.specRepository, branch: input.branch });
4194
4222
  const primary = primaryOf(repositories);
4195
4223
  if (primary === void 0) return fail("the work item names no repository to clone");
@@ -4541,7 +4569,7 @@ async function startServicesFor(runtime, config, buildDir2, jobDir, itemKey, bui
4541
4569
  ...lease === void 0 ? {} : { lease },
4542
4570
  ...inherit === void 0 ? {} : { inherit },
4543
4571
  ...routeLog === void 0 ? {} : { log: routeLog },
4544
- ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream } } : {},
4572
+ ...builtIns ? { builtIns: { gatewayUrl: config.url, itemKey, claudeUpstream: runtime.claudeUpstream, claudeApiKey: managedClaudeKeyFor(jobDir) } } : {},
4545
4573
  hostEnv: runtime.hostEnv,
4546
4574
  destinationOptions: runtime.destinationOptions
4547
4575
  });
@@ -4929,8 +4957,9 @@ function supportsContainerBuilds(machine) {
4929
4957
  if (kind !== "engine" && !(kind === "desktop" && machine.inImage === true)) return false;
4930
4958
  return Number.parseInt(version ?? "", 10) >= MIN_ENGINE_MAJOR;
4931
4959
  }
4932
- function supportsMicroVmBuilds(machine) {
4933
- return machine.platform === "linux" && machine.kvm?.state === "usable" && supportsContainerBuilds(machine) && microVmAssetsPinned(machine);
4960
+ function supportsMicroVmBuilds(machine, imageBuild = "vm") {
4961
+ if (!(machine.platform === "linux" && machine.kvm?.state === "usable" && microVmAssetsPinned(machine))) return false;
4962
+ return supportsContainerBuilds(machine) || imageBuild === "vm" && builderDiskPinned(machine.arch);
4934
4963
  }
4935
4964
  function microVmArchSupported(machine) {
4936
4965
  return MICROVM_ARCHES.includes(machine.arch ?? "");
@@ -4964,4 +4993,4 @@ function describeMachineDocker(machine) {
4964
4993
  return `Docker Engine ${version ?? "of no known version"}, older than the ${MIN_ENGINE_MAJOR} that container builds need`;
4965
4994
  }
4966
4995
 
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 };
4996
+ 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 };
@@ -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-AVPLEFQR.js';
6
5
  import { C } from './chunk-ANPNT6PM.js';
7
- import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
6
+ import { defaultFetch, unauthorizedMessage, resolveGatewayCredentials } from './chunk-3N77LUQI.js';
7
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.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,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-43I7PXDP.js';
4
- import { buildsDir, rootfsDir, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-PA6CK6WQ.js';
3
+ import { parseSize, BUILD_LABEL, RUNNER_LABEL, runnerLabelValue } from './chunk-5AFPP3GZ.js';
4
+ import { buildsDir, rootfsDir, runnerDir, imagesDir, builderCacheDiskPath } from './chunk-PXGU3GKY.js';
5
5
  import { spawnSync } from 'child_process';
6
6
  import { statfsSync, statSync, existsSync, readdirSync } from 'fs';
7
7
  import { dirname, join } from 'path';
@@ -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-OS7DJOQJ.js';
4
+ import { currentVersion, currentLink, isInLayout, packageRootIn, versionDir, switchCurrent, execStartLine } from './chunk-UMYYYF7B.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-PXGU3GKY.js';
7
7
  import { realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync } from 'fs';
8
8
  import { dirname, sep, join } from 'path';
9
9
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PA6CK6WQ.js';
3
+ import { hostKeyPath, runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PXGU3GKY.js';
4
4
  import { generateKeyPairSync, createPrivateKey, createPublicKey, sign } from 'crypto';
5
5
  import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs';
6
6
 
@@ -2,11 +2,11 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
4
4
  import { detectActiveSession, transcriptPathForSession } from './chunk-IP7BIBXJ.js';
5
- import { autoConnect } from './chunk-6NUPXDAA.js';
6
- import { resolveRepoIdentity, defaultProjectsDir, findTranscripts, sessionIdFromPath, scrubText } from './chunk-6ZFY2L2T.js';
5
+ import { autoConnect } from './chunk-AVPLEFQR.js';
7
6
  import { C } from './chunk-ANPNT6PM.js';
8
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3N77LUQI.js';
9
8
  import { readLatestProvenanceForSession } from './chunk-ZJSNLVCE.js';
9
+ import { resolveRepoIdentity, defaultProjectsDir, findTranscripts, sessionIdFromPath, scrubText } from './chunk-AJYZNISW.js';
10
10
  import { launchedItemForSession } from './chunk-T2Q7ISPE.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
12
  import { cliInvocation } from './chunk-CRB3POP4.js';
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { scrubReason, stripTerminalControls } from './chunk-ACRRO3MB.js';
4
- import { RunnerAlreadyRunningError, readPidFile } from './chunk-F5UL23I2.js';
3
+ import { scrubReason, stripTerminalControls } from './chunk-FD5ASWTG.js';
4
+ import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-INOUUSYI.js';
5
+ import { RunnerAlreadyRunningError, readPidFile } from './chunk-YNMVVQOQ.js';
5
6
  import { isSameProcess } from './chunk-JBJTC3UU.js';
6
- import { checkFit, RUNNER_RESERVE_BYTES } from './chunk-AMEM2ZLL.js';
7
- import { isSignatureRefusal, postJson } from './chunk-Z4KWHSO4.js';
8
- import { signerFor } from './chunk-SOI6K5DY.js';
9
- import { pidFilePath } from './chunk-PA6CK6WQ.js';
7
+ import { isSignatureRefusal, postJson } from './chunk-UN3SQTVL.js';
8
+ import { signerFor } from './chunk-MOI2KDLH.js';
9
+ import { pidFilePath } from './chunk-PXGU3GKY.js';
10
10
  import { readFileSync } from 'fs';
11
11
 
12
12
  createRequire(import.meta.url);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-BALIE3BA.js';
3
+ import { RELAY_PORT, GATEWAY_SOCKET, GATEWAY_PORT, CLAUDE_SOCKET, CLAUDE_PORT, DESTINATION_BASE_PORT } from './chunk-G4W4B33M.js';
4
4
  import { symlinkSync, unlinkSync } from 'fs';
5
5
  import { join } from 'path';
6
6
 
@@ -1,9 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_UNIT_NAME } from './chunk-AMEM2ZLL.js';
4
- import { RUNNER_FILE_MODE } from './chunk-PA6CK6WQ.js';
5
- import { claudeEnvPath, withoutCredentialLines } from './chunk-BALIE3BA.js';
6
- import { parseRunnerEnv } from './chunk-HACGUL52.js';
3
+ import { DEFAULT_UNIT_NAME } from './chunk-INOUUSYI.js';
4
+ import { RUNNER_FILE_MODE } from './chunk-PXGU3GKY.js';
5
+ import { claudeEnvPath, withoutCredentialLines, parseRunnerEnv } from './chunk-G4W4B33M.js';
7
6
  import { existsSync, readFileSync, writeFileSync, renameSync, rmSync } from 'fs';
8
7
  import { join, dirname } from 'path';
9
8
 
@@ -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-UMYYYF7B.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';
@@ -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,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-TBKV4L2W.js';
5
5
  import { VoiceDownloadError, downloadPinned, sha256OfFile } from './chunk-2PGI6RDE.js';
6
- import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-ES4ULBAL.js';
6
+ import { VOICE_PACK_FILES, VOICE_PACK_VERSION } from './chunk-4UPET3R7.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-AVPLEFQR.js';
10
9
  import { C } from './chunk-ANPNT6PM.js';
11
- import { defaultFetch, resolveGatewayCredentials } from './chunk-6RKD7YZ6.js';
10
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-3N77LUQI.js';
11
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.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';
@@ -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-G4W4B33M.js';
4
4
  import { join, dirname } from 'path';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { uploadSpooledSteps } from './chunk-QMWUPRYQ.js';
3
+ import { uploadSpooledSteps } from './chunk-EGVHFHY4.js';
4
4
  import { LaunchFilter } from './chunk-ESVW4MJY.js';
5
5
  import { RepoFilter } from './chunk-TBT347UY.js';
6
- import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-MECW77XP.js';
7
- import { setCustomScrubbers, setLocalIdentity, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, sessionIdFromPath, scrubDeep, SOURCE_ADAPTERS } from './chunk-6ZFY2L2T.js';
8
6
  import { C } from './chunk-ANPNT6PM.js';
9
- import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
7
+ import { migrateLegacyArtifactSidecars, planArtifactUpload, artifactsStatePath, sanitizeTerminal, acquireArtifactSpoolLock, artifactBlobsDir, resolveArtifactTurnIndex, isArtifactTombstoned, ARTIFACT_RETRY_MAX_AGE_MS, writeArtifactSpoolState, reclaimUnneededArtifactBlobs, neededArtifactShas } from './chunk-MECW77XP.js';
8
+ import { cliFetch, resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3N77LUQI.js';
10
9
  import { readCloudConfig, cloudConfigPath, writeCloudConfig } from './chunk-PJDQPF5N.js';
11
- import { signerFor, signRunnerRequest } from './chunk-SOI6K5DY.js';
12
- import { writeSyncStatus, spoolDir } from './chunk-65AKMFBH.js';
10
+ import { signerFor, signRunnerRequest } from './chunk-MOI2KDLH.js';
11
+ import { writeSyncStatus, spoolDir } from './chunk-25GRRBTH.js';
13
12
  import { readLatestProvenanceForSession, readContextProvenance } from './chunk-ZJSNLVCE.js';
14
13
  import { hookExecSpoolPath } from './chunk-2O5KA67H.js';
15
14
  import { applyReportedCost } from './chunk-BKO6JEZI.js';
16
15
  import { readRepoConnection, findGitDirs } from './chunk-BJ3KTMDH.js';
16
+ import { setCustomScrubbers, setLocalIdentity, tailTranscript, enrichSessionRepo, scanAll, setRepoRoot, resolveRepoIdentity, sessionIdFromPath, scrubDeep, SOURCE_ADAPTERS } from './chunk-AJYZNISW.js';
17
17
  import { readLaunchSpoolState, launchStatusIsDecisive, launchedItemsBySession, launchesPath } from './chunk-T2Q7ISPE.js';
18
18
  import { cliInvocation } from './chunk-CRB3POP4.js';
19
19
  import { removeJournalHooks } from './chunk-TUSYOL2O.js';
@@ -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-AVPLEFQR.js';
7
6
  import { C } from './chunk-ANPNT6PM.js';
8
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3N77LUQI.js';
8
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.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,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { WorkCommandError, postJson } from './chunk-Z4KWHSO4.js';
4
- import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-O6DYCIVW.js';
5
- import { signingFetchFor } from './chunk-6RKD7YZ6.js';
6
- import { signerFor } from './chunk-SOI6K5DY.js';
7
- import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-PA6CK6WQ.js';
3
+ import { WorkCommandError, postJson } from './chunk-UN3SQTVL.js';
4
+ import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-CAQCDYKF.js';
5
+ import { signingFetchFor } from './chunk-3N77LUQI.js';
6
+ import { signerFor } from './chunk-MOI2KDLH.js';
8
7
  import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-FGF52V4V.js';
9
8
  import { SHIM_SCRIPT, GOVERNANCE_VARIABLE } from './chunk-HCVLP7XA.js';
10
9
  import { readDegraded, readContextManifest, readSourceCache } from './chunk-YQR6E6OV.js';
10
+ import { SHIM_DIR, stagedContextDir, contextHomeDir, deliveryDir, keptContextDir } from './chunk-PXGU3GKY.js';
11
11
  import { fstatSync, mkdirSync, writeFileSync, chmodSync, rmSync, cpSync, readFileSync, existsSync, lstatSync } from 'fs';
12
12
  import { relative, join, dirname } from 'path';
13
13
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { stripTerminalControls } from './chunk-ACRRO3MB.js';
4
- import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-MZBQTVFG.js';
3
+ import { stripTerminalControls } from './chunk-FD5ASWTG.js';
4
+ import { tagToPull, imageTag, pullInstruction, readUpdateStatus, runnerImageVersion } from './chunk-SYVRBBLW.js';
5
5
  import { readFileSync } from 'fs';
6
6
 
7
7
  createRequire(import.meta.url);
@@ -55,7 +55,7 @@ function envNamesOf(row, imageEnv) {
55
55
  return [...new Set(names)].sort();
56
56
  }
57
57
  async function readOwnContainer(deps = {}) {
58
- const run = deps.run ?? (await import('./docker-DJ73SZRC.js')).spawnRun;
58
+ const run = deps.run ?? (await import('./docker-TAC6G4VU.js')).spawnRun;
59
59
  const ids = candidateIds(deps.env ?? process.env, deps.readFile ?? ((path) => readFileSync(path, "utf8")));
60
60
  if (ids.length === 0) return { ok: false, reason: "the runner cannot tell which container it runs in: HOSTNAME is empty and /proc/self/mountinfo names none" };
61
61
  let problem = "";
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RELAY_PORT, BUILD_HOME } from './chunk-BALIE3BA.js';
3
+ import { RELAY_PORT, BUILD_HOME } from './chunk-G4W4B33M.js';
4
4
  import { createServer, connect } from 'net';
5
5
 
6
6
  createRequire(import.meta.url);
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'node:module';
3
+ import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-INOUUSYI.js';
4
+ import { inspectService, realInspectProbes } from './chunk-G4W4B33M.js';
5
+ import { realpathSync, readFileSync, readdirSync } from 'fs';
6
+ import { resolve, dirname, join } from 'path';
7
+
8
+ createRequire(import.meta.url);
9
+ function realUnitFiles(directory = "/etc/systemd/system") {
10
+ return {
11
+ list: () => {
12
+ try {
13
+ return readdirSync(directory).filter((name) => name.endsWith(".service")).map((name) => name.slice(0, -".service".length));
14
+ } catch {
15
+ return [];
16
+ }
17
+ },
18
+ read: (name) => {
19
+ try {
20
+ return readFileSync(join(directory, `${name}.service`), "utf8");
21
+ } catch {
22
+ return void 0;
23
+ }
24
+ }
25
+ };
26
+ }
27
+ function findServiceUnit(configDir, units = realUnitFiles()) {
28
+ const absolute = resolve(configDir);
29
+ const folders = /* @__PURE__ */ new Set([absolute, resolvedOr(absolute)]);
30
+ const lines = [...folders].map((folder) => `EnvironmentFile=-${escapeUnitPath(`${folder}/runner.env`)}`);
31
+ for (const name of units.list()) {
32
+ const text = units.read(name);
33
+ if (text?.startsWith(UNIT_MARKER) !== true) continue;
34
+ const have = text.split("\n");
35
+ if (lines.some((line) => have.includes(line))) return name;
36
+ }
37
+ return DEFAULT_UNIT_NAME;
38
+ }
39
+ function resolvedOr(path) {
40
+ try {
41
+ return realpathSync(path);
42
+ } catch {
43
+ return path;
44
+ }
45
+ }
46
+ function inspectRunnerService(configPath, probes = realInspectProbes(), units = realUnitFiles()) {
47
+ const configDir = dirname(configPath);
48
+ return inspectService(findServiceUnit(configDir, units), configDir, probes);
49
+ }
50
+
51
+ export { findServiceUnit, inspectRunnerService };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { isVersion, compareVersions } from './chunk-TQMI335S.js';
4
- import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PA6CK6WQ.js';
4
+ import { RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-PXGU3GKY.js';
5
5
  import { readFileSync, mkdirSync, writeFileSync, renameSync } from 'fs';
6
6
  import { join } from 'path';
7
7
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { staleBuildRefusal, staleBuildWarning, detectCi } from './chunk-YGSY2NWU.js';
3
+ import { staleBuildRefusal, staleBuildWarning, detectCi } from './chunk-QANM5COC.js';
4
4
  import { launchRefusalForSession } from './chunk-ESVW4MJY.js';
5
5
  import { detectActiveSession } from './chunk-IP7BIBXJ.js';
6
- import { autoConnect } from './chunk-6NUPXDAA.js';
7
- import { readEffectiveArtifactSpoolState, localArtifactIds, isArtifactTombstoned, artifactBlobsDir, appendArtifactRecord, artifactsSpoolPath, findPendingArtifactRecord, sanitizeTerminal, appendArtifactTombstone } from './chunk-MECW77XP.js';
8
- import { resolveRepoIdentity } from './chunk-6ZFY2L2T.js';
6
+ import { autoConnect } from './chunk-AVPLEFQR.js';
9
7
  import { C } from './chunk-ANPNT6PM.js';
10
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6RKD7YZ6.js';
8
+ import { readEffectiveArtifactSpoolState, localArtifactIds, isArtifactTombstoned, artifactBlobsDir, appendArtifactRecord, artifactsSpoolPath, findPendingArtifactRecord, sanitizeTerminal, appendArtifactTombstone } from './chunk-MECW77XP.js';
9
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-3N77LUQI.js';
10
+ import { resolveRepoIdentity } from './chunk-AJYZNISW.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
12
  import { cliInvocation } from './chunk-CRB3POP4.js';
13
13
  import { ARTIFACT_MAX_CAPTION_LENGTH, ArtifactCriterionIdSchema, ARTIFACT_MAX_BYTES, ARTIFACT_MAX_FILENAME_LENGTH, mediaTypeForArtifactPath, inferArtifactKind, ARTIFACT_MAX_REPLACES_TARGETS, parseTestSelector, parseJunit, bindTests } from './chunk-EOTMDIYC.js';
@@ -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, existsSync, rmSync, mkdirSync, writeFileSync, renameSync } from 'fs';
5
5
  import { join } from 'path';
6
6