@outerlayer/cli 0.36.0-next.20261030203048 → 0.36.0-next.20261031112440

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 (121) hide show
  1. package/README.md +7 -14
  2. package/dist/{agent-setup-RZE6O737.js → agent-setup-UYTS2PHZ.js} +11 -10
  3. package/dist/{artifact-link-cmd-DLKYKNWF.js → artifact-link-cmd-W7LRR76D.js} +2 -2
  4. package/dist/{build-GVNOXEDV.js → build-KM6UILOZ.js} +4 -4
  5. package/dist/{build-disk-H5VDB4G2.js → build-disk-GCEB5EJC.js} +4 -4
  6. package/dist/build-info.json +1 -1
  7. package/dist/{builder-QW6N3XBA.js → builder-NRPJGNXU.js} +3 -3
  8. package/dist/{caller-TUO3VAKG.js → caller-XHNAY4E2.js} +6 -6
  9. package/dist/{check-E2ZTWJPM.js → check-MENIW2MN.js} +43 -44
  10. package/dist/{chunk-OSQEG4HG.js → chunk-25GQP6NR.js} +7026 -2552
  11. package/dist/{chunk-QLWEXEEA.js → chunk-34YFGWHR.js} +1 -1
  12. package/dist/{chunk-MJEUD4PD.js → chunk-3GFZSLSP.js} +4 -4
  13. package/dist/{chunk-YQDXFFOK.js → chunk-3PQTOKML.js} +1 -1
  14. package/dist/{chunk-HSSECQOA.js → chunk-3QLHEGXK.js} +2 -2
  15. package/dist/{chunk-OUMMLC45.js → chunk-3SQZ5LIK.js} +2 -2
  16. package/dist/{chunk-RUML4JVG.js → chunk-3YRJUX6J.js} +1 -1
  17. package/dist/{chunk-LOI3ESFV.js → chunk-4AMSCAHT.js} +6 -151
  18. package/dist/{chunk-OJ2KWQPQ.js → chunk-4SFHEARD.js} +1 -1
  19. package/dist/{chunk-3XIAGOPV.js → chunk-5AJZGYWC.js} +4 -4
  20. package/dist/{chunk-D4BIUQPA.js → chunk-5H57X7YC.js} +1 -1
  21. package/dist/{chunk-BBUIVGIR.js → chunk-5UBNSGK3.js} +3 -3
  22. package/dist/{chunk-7ABJKQAQ.js → chunk-6IJZL7X2.js} +2 -2
  23. package/dist/{chunk-O6V6T6HD.js → chunk-6T2JWCSZ.js} +12 -12
  24. package/dist/{chunk-7GX4X25F.js → chunk-7O7LJWQO.js} +1 -1
  25. package/dist/{chunk-TGVIFTKI.js → chunk-AVJWMOEY.js} +1 -1
  26. package/dist/{chunk-TUN3TYBX.js → chunk-BFF6AJXM.js} +8 -8
  27. package/dist/{chunk-A2QQGMQ7.js → chunk-C4YULCXX.js} +7 -7
  28. package/dist/chunk-F3ZMVUAS.js +40 -0
  29. package/dist/{chunk-OFOEDDN6.js → chunk-FRDYAKH3.js} +2 -2
  30. package/dist/{chunk-5TJQBHKO.js → chunk-GDIVOYDA.js} +4 -4
  31. package/dist/{chunk-O3OREOCP.js → chunk-GDMAN42R.js} +2 -2
  32. package/dist/{chunk-JII4O3EZ.js → chunk-GU25RNKD.js} +3 -3
  33. package/dist/{chunk-6KLNELLP.js → chunk-IVY3PD7P.js} +3 -3
  34. package/dist/{chunk-AILO7SNG.js → chunk-JFMSFHER.js} +13 -211
  35. package/dist/{chunk-FCJWPFDS.js → chunk-JPROSTGX.js} +4 -4
  36. package/dist/{chunk-3IQE34I3.js → chunk-K2YG2HZN.js} +19 -393
  37. package/dist/{chunk-4A7GNO4U.js → chunk-LESWXCKZ.js} +1 -1
  38. package/dist/{chunk-YZXI37NW.js → chunk-LHFG5YUG.js} +2 -2
  39. package/dist/{chunk-WNM5GXJ3.js → chunk-LRCGXRQI.js} +2 -2
  40. package/dist/{chunk-KSMN2FUF.js → chunk-LZ7PAU55.js} +6 -2
  41. package/dist/{chunk-VOURWC2H.js → chunk-MMDGO77D.js} +1 -1
  42. package/dist/{chunk-BIAXDR3K.js → chunk-MMXPNEEQ.js} +8 -8
  43. package/dist/{chunk-BR2WJ6BX.js → chunk-MVSC7GCE.js} +2 -2
  44. package/dist/{chunk-7K7TGHDF.js → chunk-MXWPLGO6.js} +74 -707
  45. package/dist/{chunk-EA57H6AT.js → chunk-OLENS2DD.js} +1 -1
  46. package/dist/{chunk-WQXEJ43L.js → chunk-OPF6OJAT.js} +4 -4
  47. package/dist/{chunk-XHDJ75TC.js → chunk-PDQWXH3F.js} +5 -5
  48. package/dist/{chunk-QH6RZLDV.js → chunk-PJZKKFQO.js} +1 -1
  49. package/dist/{chunk-GGNG6CVE.js → chunk-PN6TNCQI.js} +14 -7
  50. package/dist/{chunk-YTNZ237E.js → chunk-RGH5GYU2.js} +7 -7
  51. package/dist/{chunk-UCRCIRQQ.js → chunk-S6OD32NC.js} +5 -5
  52. package/dist/{chunk-D3H37WUD.js → chunk-T3AJOPUR.js} +2 -2
  53. package/dist/{chunk-UHD5ZR46.js → chunk-U553JKMO.js} +4 -4
  54. package/dist/{chunk-IZVBCDSH.js → chunk-VG2NIWR4.js} +4 -4
  55. package/dist/{chunk-ID57YZP2.js → chunk-VJYNMGCE.js} +2 -2
  56. package/dist/{chunk-QZSA5R3L.js → chunk-VUG4IZ7H.js} +1 -1
  57. package/dist/{chunk-WXR6AVZ7.js → chunk-XTVVKNRP.js} +41 -10
  58. package/dist/{claude-launcher-FK5ZQWXC.js → claude-launcher-YV3TDXBU.js} +5 -5
  59. package/dist/{cli-YMCBXWRM.js → cli-TAFO3WOQ.js} +116 -118
  60. package/dist/{command-AYXNOGIU.js → command-TRSFSBT5.js} +45 -25
  61. package/dist/{config-NVGVPL3L.js → config-YCQV3OQK.js} +5 -5
  62. package/dist/{connect-cmd-KO2TIY6J.js → connect-cmd-IRJ3MBPY.js} +8 -8
  63. package/dist/{container-start-KS52ID4M.js → container-start-UY2YVY3L.js} +39 -40
  64. package/dist/{context-cleanup-2MTGLUYS.js → context-cleanup-TPHCVVFV.js} +3 -3
  65. package/dist/{context-show-cmd-XLER7QAI.js → context-show-cmd-YQEQ5B34.js} +9 -9
  66. package/dist/{control-plane-launch-RUJOCYEI.js → control-plane-launch-UWFQWMWB.js} +11 -6
  67. package/dist/{demo-voice-cmd-GLN5QZJP.js → demo-voice-cmd-QAH7KPVO.js} +15 -16
  68. package/dist/dist-2SPMAD7Z.js +7 -0
  69. package/dist/{docker-3AZ3ZFLA.js → docker-2247NBIK.js} +3 -3
  70. package/dist/{doctor-TLIRZM2C.js → doctor-VVFPHFS4.js} +46 -27
  71. package/dist/{emit-artifact-cmd-CNC5CPKI.js → emit-artifact-cmd-3YHOU4TI.js} +13 -14
  72. package/dist/{emit-cmd-6NZOT5DS.js → emit-cmd-HNXRGC5Z.js} +7 -6
  73. package/dist/{emit-criteria-cmd-BNXWF46E.js → emit-criteria-cmd-NN52H53B.js} +10 -10
  74. package/dist/{emit-demo-cmd-UXTH6XBO.js → emit-demo-cmd-V7CP333I.js} +15 -16
  75. package/dist/{emit-finding-cmd-5HZE7W6C.js → emit-finding-cmd-J5UZGNP4.js} +10 -10
  76. package/dist/{emit-result-cmd-KAEWXQIH.js → emit-result-cmd-IWMACBFI.js} +12 -13
  77. package/dist/{emit-step-cmd-HSKB3SNR.js → emit-step-cmd-SRWFWEU7.js} +10 -10
  78. package/dist/{find-unit-CNYGB5AN.js → find-unit-FEYD4IHC.js} +7 -7
  79. package/dist/{findings-cmd-2OQMIVHA.js → findings-cmd-BWTLCXDR.js} +10 -10
  80. package/dist/{fleet-readiness-PCQSCHQ5.js → fleet-readiness-FAKMWCJV.js} +8 -8
  81. package/dist/{governing-source-7XCL3AYM.js → governing-source-6ANJ4HQI.js} +14 -13
  82. package/dist/{guest-init-2TTQKFFZ.js → guest-init-WPUS45IN.js} +2 -2
  83. package/dist/{hook-fast-EMZVAUJ5.js → hook-fast-3HPWMSFB.js} +1 -1
  84. package/dist/{host-checks-TRVDAYBL.js → host-checks-TX22YEFD.js} +37 -38
  85. package/dist/index.js +4 -4
  86. package/dist/{init-OOYCYL2C.js → init-36AY3ZQZ.js} +44 -24
  87. package/dist/init-IYL3YXEM.js +78 -0
  88. package/dist/{init-cmd-4PVOILZD.js → init-cmd-JK2OGQU5.js} +18 -18
  89. package/dist/{init-update-QMSQEZQU.js → init-update-4IQPGOA6.js} +24 -31
  90. package/dist/{layout-YJ2RD5H2.js → layout-TLUOMM6F.js} +4 -4
  91. package/dist/{login-browser-TWUHD2DS.js → login-browser-ODTJEGDN.js} +2 -2
  92. package/dist/{loop-EIR2YPA2.js → loop-U72FDFQR.js} +42 -43
  93. package/dist/machine-S2TYJJPP.js +78 -0
  94. package/dist/{machine-skills-FWIZV5HO.js → machine-skills-VRUJVBQV.js} +4 -4
  95. package/dist/{runner-env-IDGTVTYW.js → runner-env-OPRWKIKI.js} +7 -7
  96. package/dist/{runner-identity-RJYVFQ5K.js → runner-identity-OY75LG6G.js} +3 -3
  97. package/dist/{runner-key-BKMFJ7RA.js → runner-key-6WN67PRU.js} +44 -24
  98. package/dist/{session-sender-QDZWNAY7.js → session-sender-EINASB3R.js} +13 -14
  99. package/dist/{spec-cmd-OYQEUAMI.js → spec-cmd-253AGRFF.js} +11 -11
  100. package/dist/{starter-pack-6FOYP6DY.js → starter-pack-7QNUT74O.js} +5 -5
  101. package/dist/{status-BZ37VEAJ.js → status-WCQG6SX4.js} +37 -38
  102. package/dist/{sync-cmd-MNXFOIHW.js → sync-cmd-Z6PU33GC.js} +12 -13
  103. package/dist/{update-steps-VPBGYVW5.js → update-steps-BOKCWGQ6.js} +38 -39
  104. package/dist/{watch-E7RGSZF6.js → watch-XNBXSIEI.js} +12 -13
  105. package/dist/{work-claim-cmd-HX7DGFY3.js → work-claim-cmd-2A6D5EYO.js} +15 -15
  106. package/dist/{work-cmd-IEC6XKC6.js → work-cmd-JZUBXXJN.js} +10 -10
  107. package/dist/{work-comment-cmd-X65LS27O.js → work-comment-cmd-L4R6ZXLO.js} +12 -12
  108. package/dist/{work-demo-cmd-D7WGXJOC.js → work-demo-cmd-YNPN2PHQ.js} +10 -10
  109. package/dist/{work-logs-cmd-FQH2UVMI.js → work-logs-cmd-CSQJB5MD.js} +10 -10
  110. package/dist/{work-open-pr-cmd-EFAFERSF.js → work-open-pr-cmd-Y7YNI2PF.js} +11 -11
  111. package/dist/{work-pr-cmd-E55GPZKO.js → work-pr-cmd-QGAOPNLV.js} +10 -10
  112. package/dist/{work-proofs-cmd-B5X3AJQY.js → work-proofs-cmd-RPVVD2SC.js} +12 -12
  113. package/dist/{work-proofs-record-DDOAQOPX.js → work-proofs-record-ULCY5QEP.js} +19 -20
  114. package/dist/{work-stop-cmd-ANPTSTYS.js → work-stop-cmd-LF4OTNPL.js} +10 -10
  115. package/package.json +1 -1
  116. package/dist/chunk-PHFZMU32.js +0 -3924
  117. package/dist/chunk-TBT347UY.js +0 -41
  118. package/dist/dist-4Q4Y6YJL.js +0 -7
  119. package/dist/init-HEZDVJPU.js +0 -58
  120. package/dist/machine-23Y2EHH7.js +0 -58
  121. package/dist/{chunk-H2GESWLW.js → chunk-55PYF6S2.js} +1 -1
@@ -3,34 +3,33 @@ import { createRequire } from 'node:module';
3
3
  import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-7Y5VW4JG.js';
4
4
  import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
5
5
  import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
6
- import { reportFailedStart, fitImageBuildMemory } from './chunk-WQXEJ43L.js';
7
- import { renderUpdateSteps } from './chunk-ID57YZP2.js';
8
- import { releaseLease, isUnfinished, restoreSessionIntoMicroVm, setStage, jobEnv, runHook, describeHookEnd, provisionMicroVm, deliverCommitHooks, provisionProcess, readProvisionOut, workdirProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, startSender, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, stopOrphanedMicroVms, unfinishedJobs, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, listTrackedJobs, restartSender, serveLease, vmAlive, writeGuestGhConfig, ALREADY_RELEASED, inTeardown } from './chunk-PHFZMU32.js';
6
+ import { reportFailedStart, fitImageBuildMemory } from './chunk-OPF6OJAT.js';
7
+ import { renderUpdateSteps } from './chunk-VJYNMGCE.js';
9
8
  import { RUNNER_PROTOCOL } from './chunk-3LCXSD26.js';
10
9
  import { writeFleetState } from './chunk-LGV5N5DG.js';
11
10
  import { writePendingUpdate } from './chunk-EZRAR5YG.js';
12
- import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
13
- import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, createHousekeepingDocker, housekeepingDockerIfReachable, KIND_LABEL, RECIPE_KEY_LABEL, askFleetMachine } from './chunk-LOI3ESFV.js';
11
+ import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, askFleetMachine } from './chunk-4AMSCAHT.js';
14
12
  import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-AF6DQJ5W.js';
15
- import { RepoFilter } from './chunk-TBT347UY.js';
16
- import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, LEASE_SECONDS, itemTag, prepareResume, restoreSessionIntoContainer, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionEnvironment, resolveHostBuild, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, containerCommandExec, execCommandLine, startHostServices, HELPER_ENV, setUpRunnerCgroup, sweepImageBuilders, usableCpus, stoppedHelperReason, measureDisk, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel, selectStaleIncomplete, selectExpired, selectToFit, removeSavedState, shellQuote, deliverJobFiles } from './chunk-OSQEG4HG.js';
17
- import { RUNNER_RESERVE_BYTES } from './chunk-BR2WJ6BX.js';
18
- import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-WAZJPDR2.js';
19
- import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
20
- import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-KSMN2FUF.js';
13
+ import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, releaseLease, LEASE_SECONDS, itemTag, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionMicroVm, deliverCommitHooks, provisionProcess, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, currentSkillCommand, formerSkillProblem, MICROVM_COMMAND_DIR, commandLogOffset, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isContainerTracked, isMicroVmTracked, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, unfinishedJobs, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, usableCpus, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, restartSender, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, createLeaseChannel, serveLease, vmAlive, writeGuestGhConfig, shellQuote, deliverJobFiles, inTeardown } from './chunk-25GQP6NR.js';
14
+ import { RepoFilter } from './chunk-XTVVKNRP.js';
15
+ import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
21
16
  import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-ALEUIS35.js';
22
17
  import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
23
- import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls } from './chunk-RUML4JVG.js';
24
- import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-HSSECQOA.js';
25
- import { allocatedBytes, freeBytes, formatBytes } from './chunk-TGVIFTKI.js';
26
- import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun, readJobFileChecked } from './chunk-QH6RZLDV.js';
27
- import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-UCRCIRQQ.js';
18
+ import { RUNNER_RESERVE_BYTES } from './chunk-MVSC7GCE.js';
19
+ import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-WAZJPDR2.js';
20
+ import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-LZ7PAU55.js';
21
+ import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
22
+ import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls } from './chunk-3YRJUX6J.js';
23
+ import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinProcess, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-3QLHEGXK.js';
24
+ import { allocatedBytes, freeBytes, formatBytes } from './chunk-AVJWMOEY.js';
25
+ import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, builderName, runnerLabelValue, ensureFailureCount, builderSpec, ensureBuilder, spawnRun } from './chunk-PJZKKFQO.js';
26
+ import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-S6OD32NC.js';
28
27
  import { loadHostKey, ensureHostKey, signerFor } from './chunk-4DJZSNVT.js';
29
28
  import { resolveVersion } from './chunk-RA3O54FC.js';
30
- import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, storeScopes, imagesDir, spoolDir, orgStoreIn, builderCacheDiskPath, sessionsDir, rootfsDir } from './chunk-WT7J2627.js';
29
+ import { RUNNER_DIR_MODE, runnerDir, buildDir, attemptStamp, jobDir, RUNNER_FILE_MODE, jobsDir, pidFilePath, storeScopes, imagesDir } from './chunk-WT7J2627.js';
31
30
  import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, sharedUserEnvironment, JOB_MOUNT, takeClaudeCredential, heldClaudeCredential, currentClaudeCredential, fdName } from './chunk-GANAOCHR.js';
32
31
  import { COMMAND_LOST_REASON, CONTAINER_STOPPED_REASON } from './chunk-MESOOLF4.js';
33
- import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync, lstatSync } from 'fs';
32
+ import { mkdirSync, existsSync, chmodSync, writeFileSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync } from 'fs';
34
33
  import { join, dirname } from 'path';
35
34
  import { randomBytes, createHash } from 'crypto';
36
35
  import { totalmem, userInfo, constants } from 'os';
@@ -908,379 +907,6 @@ function settleUpdate(args) {
908
907
  args.log.error(`could not keep the update to ${marker.to}: ${messageOf(err)}`);
909
908
  }
910
909
  }
911
-
912
- // src/runner/housekeeping/select.ts
913
- var DAY_MS = 864e5;
914
- function spoolMaxAgeMs() {
915
- return 24 * 36e5;
916
- }
917
- function selectJobDirs(entries, nowMs, keepDays) {
918
- return entries.filter(
919
- (entry) => (entry.state === "finished" || entry.state === "no_job_file") && nowMs - entry.mtimeMs > keepDays * DAY_MS
920
- );
921
- }
922
- function liveBuildIds(jobs) {
923
- const ids = /* @__PURE__ */ new Set();
924
- for (const job of jobs) {
925
- for (const id of [job.container?.buildId, job.microvm?.buildId, job.build?.buildId, job.checkContainer?.buildId]) if (id !== void 0) ids.add(id);
926
- }
927
- return ids;
928
- }
929
- function finishedBuildIds(jobs) {
930
- return liveBuildIds(jobs);
931
- }
932
- function liveImageIds(jobs) {
933
- const ids = /* @__PURE__ */ new Set();
934
- for (const job of jobs) {
935
- for (const id of [job.container?.imageId, job.microvm?.imageId]) if (id !== void 0) ids.add(id);
936
- }
937
- return ids;
938
- }
939
- function selectOrphans(items, live, finished) {
940
- return items.filter((item) => !live.has(item.build) && (item.owned || finished.has(item.build)));
941
- }
942
- function rootDiskImageId(fileName) {
943
- if (!fileName.endsWith(".ext4") || fileName.includes(".partial-")) return void 0;
944
- const id = fileName.slice(0, -".ext4".length);
945
- return id === "" ? void 0 : id;
946
- }
947
- function selectSpool(files, nowMs, buildRunning) {
948
- return buildRunning ? [] : files.filter((file) => nowMs - file.mtimeMs > spoolMaxAgeMs());
949
- }
950
-
951
- // src/runner/housekeeping/run.ts
952
- function sizeOf(path) {
953
- try {
954
- const stats = lstatSync(path);
955
- if (!stats.isDirectory()) return stats.size;
956
- return readdirSync(path).reduce((sum, name) => sum + sizeOf(join(path, name)), 0);
957
- } catch {
958
- return 0;
959
- }
960
- }
961
- function listDir(path) {
962
- try {
963
- return readdirSync(path);
964
- } catch {
965
- return [];
966
- }
967
- }
968
- function mtimeOf(path) {
969
- try {
970
- return statSync(path).mtimeMs;
971
- } catch {
972
- return void 0;
973
- }
974
- }
975
- function readJobs(jobsPath) {
976
- const entries = [];
977
- const unfinished = [];
978
- const finished = [];
979
- const unreadable = [];
980
- for (const dirent of existsSync(jobsPath) ? readdirSync(jobsPath, { withFileTypes: true }) : []) {
981
- if (!dirent.isDirectory()) continue;
982
- const dirPath = join(jobsPath, dirent.name);
983
- const mtimeMs = mtimeOf(dirPath);
984
- if (mtimeMs === void 0) continue;
985
- const read = readJobFileChecked(join(dirPath, "job.json"));
986
- let state;
987
- if (read.kind === "missing") {
988
- state = "no_job_file";
989
- } else if (read.kind === "unreadable") {
990
- unreadable.push(dirent.name);
991
- state = "unreadable";
992
- } else if (isUnfinished(read.job)) {
993
- unfinished.push(read.job);
994
- state = "unfinished";
995
- } else {
996
- finished.push(read.job);
997
- state = read.job.releaseFailed === void 0 || read.job.releaseFailed === ALREADY_RELEASED ? "finished" : "release_failed";
998
- }
999
- entries.push({ name: dirent.name, mtimeMs, state });
1000
- }
1001
- return { entries, unfinished, finished, unreadable };
1002
- }
1003
- async function removeDanglingImages(docker, log, live) {
1004
- let freed = 0;
1005
- for (const image of await docker.listDanglingImages()) {
1006
- if (image.labels[KIND_LABEL] === void 0) continue;
1007
- if (live.has(image.id)) continue;
1008
- try {
1009
- await docker.removeImage(image.id);
1010
- freed += image.size;
1011
- log.line(`housekeeping: removed dangling image ${image.id.replace(/^sha256:/, "").slice(0, 12)} (${formatBytes(image.size)}), a rebuild replaced it`);
1012
- } catch (err) {
1013
- log.error(`housekeeping: could not remove dangling image ${image.id}: ${describeCallFailure(err)}`);
1014
- }
1015
- }
1016
- return freed;
1017
- }
1018
- var UNRECORDED_IMAGE_GRACE_MS = 60 * 60 * 1e3;
1019
- function recordedImages(configPath) {
1020
- const imageIds = /* @__PURE__ */ new Set();
1021
- const recipeKeys = /* @__PURE__ */ new Set();
1022
- for (const scope of storeScopes(configPath)) {
1023
- const root = imagesDir(configPath, scope);
1024
- for (const owner of listDir(root)) {
1025
- for (const repo of listDir(join(root, owner))) {
1026
- for (const entry of listDir(join(root, owner, repo))) {
1027
- const file = join(root, owner, repo, entry, "image.json");
1028
- if (!existsSync(file)) continue;
1029
- let record2;
1030
- try {
1031
- record2 = JSON.parse(readFileSync(file, "utf8"));
1032
- } catch {
1033
- return void 0;
1034
- }
1035
- if (typeof record2.imageId === "string") imageIds.add(record2.imageId);
1036
- if (typeof record2.recipeKey === "string") recipeKeys.add(record2.recipeKey);
1037
- }
1038
- }
1039
- }
1040
- }
1041
- return { imageIds, recipeKeys };
1042
- }
1043
- async function removeUnrecordedImages(docker, log, recorded, live, nowMs) {
1044
- let freed = 0;
1045
- for (const image of await docker.listLabelledImages()) {
1046
- const kind = image.labels[KIND_LABEL];
1047
- if (image.tags.length === 0 || live.has(image.id)) continue;
1048
- if (!(nowMs - image.createdMs >= UNRECORDED_IMAGE_GRACE_MS)) continue;
1049
- if (kind === "build" ? recorded.imageIds.has(image.id) : kind === "recipe" ? recorded.recipeKeys.has(image.labels[RECIPE_KEY_LABEL] ?? "") : true) continue;
1050
- try {
1051
- for (const tag of image.tags) await docker.removeImage(tag);
1052
- freed += image.size;
1053
- log.line(`housekeeping: removed ${kind} image ${image.tags.join(", ")} (${formatBytes(image.size)}), no image record names it`);
1054
- } catch (err) {
1055
- log.error(`housekeeping: could not remove image ${image.tags.join(", ")}: ${describeCallFailure(err)}`);
1056
- }
1057
- }
1058
- return freed;
1059
- }
1060
- async function runHousekeeping(options) {
1061
- const { docker, log } = options;
1062
- const nowMs = options.now().getTime();
1063
- const root = runnerDir(options.configPath);
1064
- let freed = 0;
1065
- let listed;
1066
- if (docker !== void 0) {
1067
- try {
1068
- const containers = await docker.listBuildContainers();
1069
- listed = { containers, volumes: await docker.listBuildVolumes() };
1070
- } catch (err) {
1071
- log.error(`housekeeping: Docker could not be asked, so nothing in Docker is removed this pass: ${describeCallFailure(err)}`);
1072
- }
1073
- }
1074
- const jobs = readJobs(jobsDir(options.configPath));
1075
- for (const name of jobs.unreadable) {
1076
- log.error(`housekeeping: job file ${name}/job.json does not parse, so nothing in Docker is removed this pass`);
1077
- }
1078
- const canTell = jobs.unreadable.length === 0;
1079
- for (const entry of selectJobDirs(jobs.entries, nowMs, options.keepDays)) {
1080
- const path = join(jobsDir(options.configPath), entry.name);
1081
- const size = sizeOf(path);
1082
- try {
1083
- rmSync(path, { recursive: true, force: true });
1084
- freed += size;
1085
- log.line(`housekeeping: removed job directory ${entry.name} (${formatBytes(size)}), last changed ${formatDuration(nowMs - entry.mtimeMs)} ago`);
1086
- } catch (err) {
1087
- log.error(`housekeeping: could not remove job directory ${entry.name}: ${describeCallFailure(err)}`);
1088
- }
1089
- }
1090
- const live = liveBuildIds(jobs.unfinished);
1091
- const finished = finishedBuildIds(jobs.finished);
1092
- if (docker !== void 0 && canTell && listed !== void 0) {
1093
- for (const container of selectOrphans(listed.containers, live, finished)) {
1094
- try {
1095
- await docker.removeContainer(container.id);
1096
- log.line(`housekeeping: removed container ${container.id.slice(0, 12)}, no unfinished build ${container.build} names it`);
1097
- } catch (err) {
1098
- log.error(`housekeeping: could not remove container ${container.id}: ${describeCallFailure(err)}`);
1099
- }
1100
- }
1101
- for (const volume of selectOrphans(listed.volumes, live, finished)) {
1102
- try {
1103
- await docker.removeVolume(volume.name);
1104
- log.line(`housekeeping: removed volume ${volume.name}, no unfinished build ${volume.build} names it`);
1105
- } catch (err) {
1106
- log.error(`housekeeping: could not remove volume ${volume.name}: ${describeCallFailure(err)}`);
1107
- }
1108
- }
1109
- }
1110
- if (docker !== void 0 && canTell && listed !== void 0) {
1111
- const recorded = recordedImages(options.configPath);
1112
- if (recorded === void 0) {
1113
- log.error("housekeeping: an image record does not parse, so no tagged image is removed this pass");
1114
- } else {
1115
- try {
1116
- freed += await removeUnrecordedImages(docker, log, recorded, liveImageIds(jobs.unfinished), nowMs);
1117
- } catch (err) {
1118
- log.error(`housekeeping: the runner's images could not be listed: ${describeCallFailure(err)}`);
1119
- }
1120
- }
1121
- freed += await removeStaleRootDisks(root, jobs.unfinished, options, docker);
1122
- try {
1123
- freed += await removeDanglingImages(docker, log, liveImageIds(jobs.unfinished));
1124
- } catch (err) {
1125
- log.error(`housekeeping: dangling images could not be listed: ${describeCallFailure(err)}`);
1126
- }
1127
- if (options.removeHostBuilder === true) {
1128
- try {
1129
- const removed = await docker.removeBuilder();
1130
- if (removed !== void 0) {
1131
- freed += removed.freedBytes;
1132
- log.line(`housekeeping: removed the host image builder and its state volume, freed ${formatBytes(removed.freedBytes)}; this runner builds images in the builder microVM`);
1133
- }
1134
- } catch (err) {
1135
- log.error(`housekeeping: the host image builder could not be removed: ${describeCallFailure(err)}`);
1136
- }
1137
- } else if (options.buildCacheMax !== "off") {
1138
- try {
1139
- const pruned = await docker.builderPrune(options.buildCacheMax);
1140
- if (pruned === void 0) {
1141
- log.line("housekeeping: the image builder is not running, so its build cache is left for a later pass");
1142
- } else {
1143
- freed += pruned.freedBytes;
1144
- log.line(`housekeeping: pruned the image builder's build cache down to ${formatBytes(options.buildCacheMax)}, freed ${formatBytes(pruned.freedBytes)}`);
1145
- }
1146
- } catch (err) {
1147
- log.error(`housekeeping: the build cache could not be pruned: ${describeCallFailure(err)}`);
1148
- }
1149
- }
1150
- }
1151
- freed += await removeSavedStates(options, nowMs, savedStatesDir(root));
1152
- freed += removeStaleBuilderCaches(options, nowMs);
1153
- freed += removeStaleSessions(options, nowMs);
1154
- for (const scope of storeScopes(options.configPath)) {
1155
- const spoolPath = spoolDir(orgStoreIn(root, scope));
1156
- const spoolFiles = listDir(spoolPath).flatMap((name) => {
1157
- const mtimeMs = mtimeOf(join(spoolPath, name));
1158
- return mtimeMs === void 0 ? [] : [{ name, mtimeMs }];
1159
- });
1160
- for (const file of selectSpool(spoolFiles, nowMs, jobs.unfinished.length > 0)) {
1161
- const path = join(spoolPath, file.name);
1162
- const size = sizeOf(path);
1163
- try {
1164
- rmSync(path, { recursive: true, force: true });
1165
- freed += size;
1166
- log.line(`housekeeping: removed spool file ${file.name} (${formatBytes(size)}), last changed ${formatDuration(nowMs - file.mtimeMs)} ago and no build is running`);
1167
- } catch (err) {
1168
- log.error(`housekeeping: could not remove spool file ${file.name}: ${describeCallFailure(err)}`);
1169
- }
1170
- }
1171
- }
1172
- log.line(`housekeeping: pass finished, freed ${formatBytes(freed)}`);
1173
- return { freedBytes: freed };
1174
- }
1175
- async function removeSavedStates(options, nowMs, dir) {
1176
- const records = readRecords(dir);
1177
- const reasons = /* @__PURE__ */ new Map();
1178
- for (const record2 of selectStaleIncomplete(records, nowMs)) reasons.set(record2.id, "its copy never finished");
1179
- for (const record2 of selectExpired(records.filter((r) => r.complete), nowMs)) reasons.set(record2.id, "it is at least 7 days old");
1180
- if (options.savedStateMax !== void 0) {
1181
- const kept = records.filter((record2) => record2.complete && !reasons.has(record2.id));
1182
- const max = options.savedStateMax === "off" ? 0 : options.savedStateMax;
1183
- for (const record2 of selectToFit(kept, max)) reasons.set(record2.id, "the saved states pass runner.housekeeping.savedStateMax");
1184
- }
1185
- let freed = 0;
1186
- const docker = options.docker;
1187
- for (const record2 of records.filter((r) => reasons.has(r.id))) {
1188
- try {
1189
- await removeSavedState(record2, {
1190
- dir,
1191
- removeVolume: async (name) => {
1192
- if (docker === void 0) throw new Error("Docker is not available");
1193
- await docker.removeVolume(name);
1194
- }
1195
- });
1196
- freed += record2.bytes;
1197
- options.log.line(`housekeeping: removed saved state ${record2.id} (${formatBytes(record2.bytes)}), ${reasons.get(record2.id)}`);
1198
- } catch (err) {
1199
- options.log.error(`housekeeping: could not remove saved state ${record2.id} (${describeSaved(record2)}): ${describeCallFailure(err)}`);
1200
- }
1201
- }
1202
- return freed;
1203
- }
1204
- function describeSaved(record2) {
1205
- return record2.volume ?? record2.path ?? record2.kind;
1206
- }
1207
- async function removeStaleRootDisks(root, unfinished, options, docker) {
1208
- let freed = 0;
1209
- for (const scope of storeScopes(options.configPath)) freed += await removeStaleRootDisksIn(orgStoreIn(root, scope), unfinished, options, docker);
1210
- return freed;
1211
- }
1212
- async function removeStaleRootDisksIn(root, unfinished, options, docker) {
1213
- const dir = rootfsDir(root);
1214
- const inUse = new Set(unfinished.flatMap((job) => job.microvm?.rootfs === void 0 ? [] : [job.microvm.rootfs]));
1215
- let freed = 0;
1216
- for (const name of listDir(dir)) {
1217
- const imageId = rootDiskImageId(name);
1218
- if (imageId === void 0) continue;
1219
- const path = join(dir, name);
1220
- if (inUse.has(path)) continue;
1221
- if (await docker.imageState(`sha256:${imageId}`) !== "missing") continue;
1222
- const size = sizeOf(path);
1223
- try {
1224
- rmSync(path, { force: true });
1225
- freed += size;
1226
- options.log.line(`housekeeping: removed root disk ${name} (${formatBytes(size)}), Docker no longer has its image`);
1227
- } catch (err) {
1228
- options.log.error(`housekeeping: could not remove root disk ${name}: ${describeCallFailure(err)}`);
1229
- }
1230
- }
1231
- return freed;
1232
- }
1233
- function removeStaleSessions(options, nowMs) {
1234
- let freed = 0;
1235
- for (const scope of storeScopes(options.configPath)) {
1236
- const where = sessionsDir(options.configPath, scope);
1237
- for (const name of listDir(where)) {
1238
- const path = join(where, name);
1239
- const keptAt = Date.parse(readKeptAt(path) ?? "");
1240
- const sinceMs = Number.isFinite(keptAt) ? keptAt : mtimeOf(path);
1241
- if (sinceMs === void 0 || nowMs - sinceMs < options.keepDays * 864e5) continue;
1242
- const size = sizeOf(path);
1243
- try {
1244
- rmSync(path, { recursive: true, force: true });
1245
- freed += size;
1246
- options.log.line(`housekeeping: removed kept session of work item ${name} (${formatBytes(size)}), kept ${formatDuration(nowMs - sinceMs)} ago`);
1247
- } catch (err) {
1248
- options.log.error(`housekeeping: could not remove the kept session of work item ${name}: ${describeCallFailure(err)}`);
1249
- }
1250
- }
1251
- }
1252
- return freed;
1253
- }
1254
- function readKeptAt(dir) {
1255
- try {
1256
- const parsed = JSON.parse(readFileSync(join(dir, "meta.json"), "utf8"));
1257
- return typeof parsed.keptAt === "string" ? parsed.keptAt : void 0;
1258
- } catch {
1259
- return void 0;
1260
- }
1261
- }
1262
- function removeStaleBuilderCaches(options, nowMs) {
1263
- let freed = 0;
1264
- for (const scope of storeScopes(options.configPath)) {
1265
- const where = scope === void 0 ? "" : `${scope}/`;
1266
- for (const owner of listDir(imagesDir(options.configPath, scope))) {
1267
- for (const name of listDir(join(imagesDir(options.configPath, scope), owner))) {
1268
- const path = builderCacheDiskPath(options.configPath, owner, name, scope);
1269
- const mtimeMs = mtimeOf(path);
1270
- if (mtimeMs === void 0 || nowMs - mtimeMs < options.keepDays * 864e5) continue;
1271
- const size = sizeOf(path);
1272
- try {
1273
- rmSync(path, { force: true });
1274
- freed += size;
1275
- options.log.line(`housekeeping: removed the builder cache disk of ${where}${owner}/${name} (${formatBytes(size)}), last used ${formatDuration(nowMs - mtimeMs)} ago`);
1276
- } catch (err) {
1277
- options.log.error(`housekeeping: could not remove the builder cache disk of ${where}${owner}/${name}: ${describeCallFailure(err)}`);
1278
- }
1279
- }
1280
- }
1281
- }
1282
- return freed;
1283
- }
1284
910
  var HOOKS_DIR_NAME = "git-hooks";
1285
911
  var CO_AUTHOR_FILE = "co-author";
1286
912
  var HOOKS = [
@@ -2545,7 +2171,7 @@ var CLAIM_REFUSAL_CODES = new Set(
2545
2171
  "pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
2546
2172
  );
2547
2173
  async function tryClaimAndStart(state, item, queue) {
2548
- const { postJson: postJson2 } = await import('./work-cmd-IEC6XKC6.js');
2174
+ const { postJson: postJson2 } = await import('./work-cmd-JZUBXXJN.js');
2549
2175
  const log = logOf(state);
2550
2176
  const hostKey = await loadHostKey(state.config.configPath);
2551
2177
  const claim = await retrySend(
@@ -3916,7 +3542,7 @@ async function startRunner(configPath, deps, startup) {
3916
3542
  check: update.check ? () => update.check(configPath) : async () => {
3917
3543
  const held = heldClaudeCredential();
3918
3544
  const env = held === void 0 ? process.env : { ...process.env, [held.variable]: held.value };
3919
- return (await import('./check-E2ZTWJPM.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3545
+ return (await import('./check-MENIW2MN.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3920
3546
  },
3921
3547
  now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
3922
3548
  log
@@ -3,7 +3,7 @@ import { createRequire } from 'node:module';
3
3
  import { toolsDockerfile } from './chunk-H3MLZ4EA.js';
4
4
  import { claimPidFile, RunnerAlreadyRunningError, releasePidFile } from './chunk-WAZJPDR2.js';
5
5
  import { startTimeOf } from './chunk-JBJTC3UU.js';
6
- import { runnerLabelValue } from './chunk-QH6RZLDV.js';
6
+ import { runnerLabelValue } from './chunk-PJZKKFQO.js';
7
7
  import { RecipeError, locateRecipe, readRecipe, assertBuildable, writeSanitizedRecipe, classifyProperties, SANITIZED_NAME } from './chunk-TV5ITSVY.js';
8
8
  import { UNIVERSAL_IMAGE_DIGEST, UNIVERSAL_IMAGE_REPOSITORY, UNIVERSAL_IMAGE_SOURCE, CLAUDE_CODE_VERSION, NODE_IMAGE, UNIVERSAL_IMAGE, MEDIA_PINS, TINI_VERSION, GH_VERSION } from './chunk-7SO2VHTQ.js';
9
9
  import { RUNNER_DIR_MODE, RUNNER_FILE_MODE, repoCacheDir, imagesDir, imageBuildLogsDir, attemptStamp, orgStore, rootfsPathFor } from './chunk-WT7J2627.js';
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-FCJWPFDS.js';
3
+ import { fetchFactories, selectFactory, saveFactoryConnection, autoConnectedLine } from './chunk-JPROSTGX.js';
4
4
  import { resolveGatewayCredentials } from './chunk-YQHEJ5SV.js';
5
5
  import { readCloudConfig } from './chunk-HWVMRETT.js';
6
6
  import { findGitDirs, readRepoConnection } from './chunk-BJ3KTMDH.js';
7
- import { resolveRepoIdentity } from './chunk-7K7TGHDF.js';
7
+ import { resolveRepoIdentity } from './chunk-MXWPLGO6.js';
8
8
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
9
  import { homeFromEnv } from './chunk-352DHUTP.js';
10
10
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-7GX4X25F.js';
4
- import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-AILO7SNG.js';
3
+ import { AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE } from './chunk-7O7LJWQO.js';
4
+ import { normalizePath, CONTEXT_PIN_FILENAME } from './chunk-JFMSFHER.js';
5
5
  import { existsSync, readdirSync, readFileSync, mkdirSync, writeFileSync, lstatSync, readlinkSync, symlinkSync, rmdirSync } from 'fs';
6
6
  import { relative, sep, join } from 'path';
7
7
 
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { WorkCommandError, postJson } from './chunk-UCRCIRQQ.js';
4
- import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-GGNG6CVE.js';
3
+ import { WorkCommandError, postJson } from './chunk-S6OD32NC.js';
4
+ import { defaultGitRunner, materializeContext, fetchControlPlaneCommit, lookupGoverningSource } from './chunk-PN6TNCQI.js';
5
+ import { buildRefusalReason } from './chunk-F3ZMVUAS.js';
5
6
  import { signingFetchFor } from './chunk-YQHEJ5SV.js';
6
7
  import { signerFor } from './chunk-4DJZSNVT.js';
7
8
  import { unsupportedLayout, layoutRefusalReason, composeDelivery } from './chunk-FGF52V4V.js';
@@ -438,6 +439,9 @@ async function stageGovernedContext(input) {
438
439
  }
439
440
  // An unreachable result is a timeout, a network failure, or a failure to write the fetched files. Its message says which.
440
441
  default:
442
+ if (result.invalidConfig !== void 0) {
443
+ return finish({ kind: "refused", reason: buildRefusalReason(readDegraded(join(tree, ".git"))?.repository ?? input.repository, result.invalidConfig) });
444
+ }
441
445
  return finish(unavailable(result.message ?? `the context of ${input.repository} could not be materialized (${result.status})`));
442
446
  }
443
447
  } catch (err) {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-BR2WJ6BX.js';
3
+ import { escapeUnitPath, UNIT_MARKER, DEFAULT_UNIT_NAME } from './chunk-MVSC7GCE.js';
4
4
  import { inspectService, realInspectProbes } from './chunk-GANAOCHR.js';
5
5
  import { realpathSync, readFileSync, readdirSync } from 'fs';
6
6
  import { resolve, dirname, join } from 'path';
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-2AM6Z5BP.js';
4
- import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-WNM5GXJ3.js';
5
- import { retiredSkillPaths, removeRetiredSkills } from './chunk-D3H37WUD.js';
6
- import { maintainedFilesForExistingSkills, loadMaintainedFiles, writeMaintainedFiles } from './chunk-7GX4X25F.js';
4
+ import { isAgentsMdLayout, discoverOuterlayerPaths, isForeignTree, toRepoRelative } from './chunk-LRCGXRQI.js';
5
+ import { invalidConfigMessage } from './chunk-F3ZMVUAS.js';
6
+ import { retiredSkillPaths, removeRetiredSkills } from './chunk-T3AJOPUR.js';
7
+ import { maintainedFilesForExistingSkills, loadMaintainedFiles, writeMaintainedFiles } from './chunk-7O7LJWQO.js';
7
8
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
- import { emitTree, generatedHeaderSource, parseOuterlayerConfig, classifyTree } from './chunk-AILO7SNG.js';
9
+ import { emitTree, generatedHeaderSource, parseOuterlayerConfig, classifyTree } from './chunk-JFMSFHER.js';
9
10
  import { existsSync, readFileSync, mkdirSync, writeFileSync, copyFileSync, unlinkSync, rmdirSync, readdirSync } from 'fs';
10
11
  import { join, dirname } from 'path';
11
12
 
@@ -16,7 +17,7 @@ var NO_CONFIG_MESSAGE = 'no .outerlayer/config.json with a non-empty targets arr
16
17
  var EmitError = class extends Error {
17
18
  };
18
19
  var EMIT_NOT_NEEDED_NOTICE = `Claude Code and Codex read AGENTS.md and .agents/skills/ without a generated copy. Run \`${cliInvocation()} init --update\` to move this repository there and stop committing generated files.`;
19
- var NATIVE_TARGETS = /* @__PURE__ */ new Set(["claude-code", "codex"]);
20
+ var NATIVE_TARGETS = /* @__PURE__ */ new Set(["claude-code"]);
20
21
  function noticeFor(repoRoot, targets) {
21
22
  if (targets.length === 0 || !targets.every((t) => NATIVE_TARGETS.has(t))) return void 0;
22
23
  return isAgentsMdLayout(repoRoot) ? void 0 : EMIT_NOT_NEEDED_NOTICE;
@@ -29,8 +30,7 @@ function resolveTargetsFromConfig(repoRoot) {
29
30
  const result = parseOuterlayerConfig(raw);
30
31
  if (result.ok) return result.config.targets;
31
32
  if (result.errors.some((e) => e.code === "no_targets")) throw new EmitError(NO_CONFIG_MESSAGE);
32
- const detail = result.errors.map((e) => `${e.path}: ${e.message}`).join("; ");
33
- throw new EmitError(`invalid .outerlayer/config.json \u2014 ${detail}`);
33
+ throw new EmitError(invalidConfigMessage(result.errors));
34
34
  }
35
35
  function buildEmitInput(repoRoot, targets, maintained, excluded = /* @__PURE__ */ new Set()) {
36
36
  const bundled = new Map(maintained.map((f) => [f.path, f.content]));
@@ -275,7 +275,7 @@ function inspectReplacedOutputs(repoRoot) {
275
275
  configured = resolveTargetsFromConfig(repoRoot);
276
276
  } catch {
277
277
  }
278
- const targets = [.../* @__PURE__ */ new Set([...configured, "claude-code", "codex"])];
278
+ const targets = [.../* @__PURE__ */ new Set([...configured, "claude-code"])];
279
279
  const maintained = maintainedFilesForExistingSkills(repoRoot, loadMaintainedFiles());
280
280
  const maintainedPaths = new Set(maintained.map((f) => f.path));
281
281
  const built = buildEmitInput(repoRoot, targets, maintained, new Set(retiredSkillPaths(repoRoot)));
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { builtinKind, keepsHostBuilder } from './chunk-HSSECQOA.js';
4
- import { parseSize } from './chunk-QH6RZLDV.js';
3
+ import { builtinKind, keepsHostBuilder } from './chunk-3QLHEGXK.js';
4
+ import { parseSize } from './chunk-PJZKKFQO.js';
5
5
  import { runnerDir } from './chunk-WT7J2627.js';
6
6
  import { FD_SLOTS_PER_BUILD, FD_STORE_ENV, BUILD_SLICE_MEMORY_ENV, CLAUDE_CREDENTIAL_ID, CLAUDE_ENV_FILE, credentialLineIn, withoutCredentialLines } from './chunk-GANAOCHR.js';
7
7
  import { existsSync, readFileSync, writeFileSync, chmodSync, renameSync } from 'fs';