@outerlayer/cli 0.38.0-next.20261109235338 → 0.38.0-next.20261110130701

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 (183) hide show
  1. package/README.md +9 -2
  2. package/dist/agent-setup-GZBGCV3K.js +40 -0
  3. package/dist/{agent-subcommand-JC5JXZ3X.js → agent-subcommand-5PNHUNZZ.js} +4 -4
  4. package/dist/{artifact-link-cmd-RUGAK5EX.js → artifact-link-cmd-XOFZP7U5.js} +2 -2
  5. package/dist/{bridge-TYO2YB2X.js → bridge-RNM7OWRW.js} +7 -7
  6. package/dist/{build-QUCL3HFM.js → build-VKO7IVOQ.js} +13 -13
  7. package/dist/{build-disk-3JUHPJEQ.js → build-disk-M2JYJF6R.js} +11 -11
  8. package/dist/build-info.json +1 -1
  9. package/dist/{builder-PADLK3VJ.js → builder-HMHJ6U7C.js} +10 -10
  10. package/dist/caller-U26SATTV.js +23 -0
  11. package/dist/{check-DBYJIP44.js → check-SJCTNS7N.js} +56 -56
  12. package/dist/{chunk-IXC5EISR.js → chunk-2TXYQANG.js} +1 -1
  13. package/dist/{chunk-HT4OKJDB.js → chunk-2WNJ2MHD.js} +1 -1
  14. package/dist/{chunk-4NRIC2G5.js → chunk-3DY4DQOC.js} +4 -4
  15. package/dist/{chunk-553QW3PJ.js → chunk-3GTAPQBG.js} +2 -2
  16. package/dist/{chunk-F3NW5TBW.js → chunk-3HJK7WTM.js} +6 -6
  17. package/dist/{chunk-KGHVJI7V.js → chunk-3W5JLANR.js} +3 -3
  18. package/dist/{chunk-X3CGWGAG.js → chunk-47JRSV6Y.js} +1 -1
  19. package/dist/{chunk-QA3U3MJZ.js → chunk-4EJHQYVI.js} +152 -34
  20. package/dist/{chunk-WISVAUTD.js → chunk-5QDHJT73.js} +4 -4
  21. package/dist/{chunk-DPBFNZ6H.js → chunk-5QFFQCSY.js} +1 -1
  22. package/dist/{chunk-P43BSQGV.js → chunk-6RQP5GP5.js} +2 -2
  23. package/dist/{chunk-RN5VLKZ2.js → chunk-6XMC6R4W.js} +1 -1
  24. package/dist/{chunk-Y67NEZMW.js → chunk-6XROZIV6.js} +6 -6
  25. package/dist/{chunk-LJPYKCIP.js → chunk-72LXVD4O.js} +4 -4
  26. package/dist/{chunk-4A4TMFGV.js → chunk-735C5J6Q.js} +5 -5
  27. package/dist/{chunk-PCY626FL.js → chunk-7E55P2NR.js} +1 -1
  28. package/dist/{chunk-O7IJBJ6Z.js → chunk-AC6DM3S3.js} +1 -1
  29. package/dist/{chunk-2TA2Z5IJ.js → chunk-ALCZ2SEW.js} +5 -5
  30. package/dist/{chunk-SKKKPLOC.js → chunk-AS4NMHJM.js} +3 -3
  31. package/dist/{chunk-OQHHPJNK.js → chunk-ATQHPT3B.js} +1 -1
  32. package/dist/{chunk-QZP3O6IM.js → chunk-B4U5XI4F.js} +69 -9
  33. package/dist/{chunk-2DVQHK37.js → chunk-B5Z4VA4Q.js} +1 -1
  34. package/dist/{chunk-XMVASSUZ.js → chunk-BCQFMAGM.js} +3 -3
  35. package/dist/{chunk-EYFIWJFI.js → chunk-BTH6HTE5.js} +5 -5
  36. package/dist/{chunk-HWHJDQLC.js → chunk-C574RHGN.js} +3 -3
  37. package/dist/{chunk-KHC7ICRR.js → chunk-CXXQQST7.js} +9 -9
  38. package/dist/{chunk-52IVBUIU.js → chunk-DKDBMMX7.js} +6 -6
  39. package/dist/{chunk-XLUQC2PE.js → chunk-EHPKACA7.js} +1 -1
  40. package/dist/{chunk-JLCEQXQF.js → chunk-ENHD5PNW.js} +1 -1
  41. package/dist/{chunk-5J4WME44.js → chunk-F2ADK2KB.js} +5 -5
  42. package/dist/{chunk-AZRZBG45.js → chunk-FGBBGUM4.js} +4 -4
  43. package/dist/{chunk-HE53NIRE.js → chunk-FXVHF6RX.js} +54 -4
  44. package/dist/{chunk-W37QA6WG.js → chunk-GJMLLXZJ.js} +1 -1
  45. package/dist/{chunk-IJWQT2Y7.js → chunk-HDEYRLWK.js} +1 -1
  46. package/dist/{chunk-A237UPRS.js → chunk-HJK2KI3Q.js} +16 -16
  47. package/dist/{chunk-G2J574LS.js → chunk-I2N427GS.js} +8 -8
  48. package/dist/{chunk-GH5Y3R5R.js → chunk-IGO766M6.js} +4 -4
  49. package/dist/{chunk-XPXJWIOJ.js → chunk-ITOIM3WV.js} +1 -1
  50. package/dist/{chunk-MGOEHY72.js → chunk-IVB6A3I7.js} +7 -7
  51. package/dist/{chunk-7HN6T4MY.js → chunk-L32O52SH.js} +1 -1
  52. package/dist/{chunk-DE5QLWJK.js → chunk-L6CZTRNW.js} +1 -1
  53. package/dist/{chunk-N2QYP3NQ.js → chunk-MBPBYMHU.js} +565 -16
  54. package/dist/{chunk-TYLZR7HX.js → chunk-MSARYPFD.js} +2 -2
  55. package/dist/{chunk-3Q2SEOT3.js → chunk-MT4XF5OL.js} +2 -2
  56. package/dist/{chunk-UU6FN6PZ.js → chunk-NE7EG3SN.js} +4 -4
  57. package/dist/{chunk-PE5J46EE.js → chunk-OEWSICWM.js} +8 -8
  58. package/dist/{chunk-26NMJGEY.js → chunk-OI4ZV7MJ.js} +1 -1
  59. package/dist/{chunk-IJ4DF5QS.js → chunk-OK4RSIB2.js} +1 -1
  60. package/dist/{chunk-ZZ4AX25R.js → chunk-OWEJP5HJ.js} +1 -1
  61. package/dist/{chunk-NL2MMRJI.js → chunk-PA6FKP5B.js} +6 -6
  62. package/dist/{chunk-ZRTGX4GN.js → chunk-QFQ2UNZU.js} +6 -6
  63. package/dist/{chunk-SOLQ3JA6.js → chunk-QGUCHNSQ.js} +66 -11
  64. package/dist/{chunk-NAU7U44X.js → chunk-QNHBJU74.js} +7 -7
  65. package/dist/{chunk-7NP5G2FV.js → chunk-RBLXGO5K.js} +2 -2
  66. package/dist/{chunk-F4XMG7EO.js → chunk-SBPMDO47.js} +1 -1
  67. package/dist/{chunk-Y2M2NZX4.js → chunk-SKGUS2CB.js} +10 -10
  68. package/dist/{chunk-5AU2GQGH.js → chunk-TD6DN5LU.js} +3 -3
  69. package/dist/{chunk-BAWOWJ3G.js → chunk-TUEEGFAQ.js} +10 -10
  70. package/dist/{chunk-FLIRUHVT.js → chunk-TUSIYONR.js} +1 -1
  71. package/dist/{chunk-HITUWIB7.js → chunk-TW2V2IQ4.js} +1 -1
  72. package/dist/{chunk-ZUIHEOSC.js → chunk-UCUBQWJC.js} +1 -1
  73. package/dist/{chunk-DQLHVV62.js → chunk-UUSSRXUJ.js} +3 -3
  74. package/dist/{chunk-6ZMFEZ2K.js → chunk-VRWZNI6U.js} +1 -1
  75. package/dist/{chunk-ZIOMM4LL.js → chunk-VU5PPWIQ.js} +7 -7
  76. package/dist/{chunk-2BMH3373.js → chunk-WH2QUYXH.js} +2 -2
  77. package/dist/{chunk-2YOFSE7U.js → chunk-WVMKXDOW.js} +30 -30
  78. package/dist/{chunk-WE4CWGNR.js → chunk-XAR2CJFV.js} +7 -7
  79. package/dist/{chunk-XDHMRHMC.js → chunk-XCTE5S2C.js} +1 -1
  80. package/dist/{chunk-6L55K352.js → chunk-XFODM3V7.js} +7 -7
  81. package/dist/{chunk-IPB5UOHH.js → chunk-XFU37HIM.js} +3 -3
  82. package/dist/{chunk-C7YFAPMY.js → chunk-YO2NPS66.js} +1 -1
  83. package/dist/chunk-YOAJLD2D.js +270 -0
  84. package/dist/{chunk-3QTC4UWC.js → chunk-YZQYTOCR.js} +1 -1
  85. package/dist/{claude-launcher-UYCMHZOU.js → claude-launcher-WMIUTAXY.js} +7 -7
  86. package/dist/{cli-KEVUJ6PY.js → cli-R5SJT3YL.js} +186 -156
  87. package/dist/{command-DNGERCQW.js → command-LWMX6I7W.js} +51 -51
  88. package/dist/{config-M66C2AGN.js → config-ZRGYLVDX.js} +12 -12
  89. package/dist/{connect-cmd-JBM5ODV3.js → connect-cmd-MZXTWM4R.js} +13 -13
  90. package/dist/{container-start-4NKXX3MA.js → container-start-VQR5ERZE.js} +49 -49
  91. package/dist/{context-cleanup-UE5HQRHP.js → context-cleanup-Z3HZZZXW.js} +4 -4
  92. package/dist/{context-show-cmd-HX5LND6O.js → context-show-cmd-SCOVPVDM.js} +14 -14
  93. package/dist/{control-plane-launch-XEMMZ7VZ.js → control-plane-launch-MWZHJ4G5.js} +14 -14
  94. package/dist/{demo-record-cmd-PI4PFFEO.js → demo-record-cmd-4RVSWVMK.js} +8 -8
  95. package/dist/{demo-voice-cmd-3GASMSCU.js → demo-voice-cmd-PGM5JPCQ.js} +20 -20
  96. package/dist/{dist-OMJJT636.js → dist-XEPPXF4M.js} +2 -2
  97. package/dist/{docker-KWHEDC6K.js → docker-25F2KOBJ.js} +10 -10
  98. package/dist/{doctor-GPATU5TY.js → doctor-3QJLCHQY.js} +51 -51
  99. package/dist/{emit-artifact-cmd-OH7PNHZF.js → emit-artifact-cmd-Z4SHPKFT.js} +19 -19
  100. package/dist/{emit-cmd-RPICQ5H2.js → emit-cmd-NHMZ4M5S.js} +7 -7
  101. package/dist/{emit-criteria-cmd-JW2GS2SO.js → emit-criteria-cmd-HCN3DOJM.js} +16 -16
  102. package/dist/{emit-demo-cmd-5W6H6AI4.js → emit-demo-cmd-NOSQTOES.js} +20 -20
  103. package/dist/{emit-finding-cmd-PSCJFCBZ.js → emit-finding-cmd-YXR3ZVCJ.js} +16 -16
  104. package/dist/{emit-result-cmd-VJZDDWD3.js → emit-result-cmd-Z7MBE37R.js} +18 -18
  105. package/dist/{emit-step-cmd-ER65MOU6.js → emit-step-cmd-JOSYDSEO.js} +16 -16
  106. package/dist/{exec-client-PHJ4YGYG.js → exec-client-SZRXXKJ5.js} +8 -8
  107. package/dist/find-unit-3RHC4375.js +24 -0
  108. package/dist/{findings-cmd-BN6LO7LI.js → findings-cmd-NGFY25WZ.js} +16 -16
  109. package/dist/{fleet-readiness-FHVT7ZXE.js → fleet-readiness-NWIVQQ4P.js} +14 -14
  110. package/dist/governing-source-DNWVPRXP.js +41 -0
  111. package/dist/{guest-init-IREU7IIE.js → guest-init-T7QJW2AJ.js} +9 -9
  112. package/dist/{hook-fast-OFCB6O5N.js → hook-fast-ECQBMESE.js} +1 -1
  113. package/dist/{hook-install-3SSLJYA3.js → hook-install-MBMG3G6B.js} +4 -4
  114. package/dist/host-checks-EHSA6FLE.js +80 -0
  115. package/dist/host-key-6SMJUTJ2.js +18 -0
  116. package/dist/{image-tag-MYCA26HL.js → image-tag-OCVY4W5D.js} +8 -8
  117. package/dist/index.js +4 -4
  118. package/dist/{init-RUY6NPTN.js → init-ETG7XYFQ.js} +47 -47
  119. package/dist/init-F7NB7GBW.js +80 -0
  120. package/dist/{init-agent-Z6PF22UT.js → init-agent-WEYGBAII.js} +47 -47
  121. package/dist/{init-cmd-3M4QENFU.js → init-cmd-KGM7TN6Z.js} +27 -27
  122. package/dist/{init-update-V4AWGCUH.js → init-update-EUJ4264S.js} +24 -24
  123. package/dist/{install-cmd-UJO2EMXF.js → install-cmd-HWG6LJX5.js} +10 -10
  124. package/dist/{layout-VZ3MERWV.js → layout-CGE4KWGO.js} +4 -4
  125. package/dist/{login-browser-ZEOXKIQ2.js → login-browser-G7WNR74C.js} +2 -2
  126. package/dist/{logs-SQJ5BKAP.js → logs-TKWJ4S4W.js} +7 -7
  127. package/dist/loop-K3QREUHK.js +90 -0
  128. package/dist/machine-5GTYN2LP.js +80 -0
  129. package/dist/{machine-skills-SAD5OWIH.js → machine-skills-CXA57QHE.js} +4 -4
  130. package/dist/{mcp-install-cmd-7KKOGEFA.js → mcp-install-cmd-6IGK65DV.js} +4 -4
  131. package/dist/{mcp-serve-cmd-EKANKY4W.js → mcp-serve-cmd-DVE5XP2U.js} +9 -9
  132. package/dist/{paths-LYF7UNWL.js → paths-VOWYUJLZ.js} +7 -7
  133. package/dist/pending-35ML3JE5.js +18 -0
  134. package/dist/{pidfile-EYAULWL2.js → pidfile-MFP6B2KV.js} +8 -8
  135. package/dist/{record-CHYO34BN.js → record-AWCJ3LTG.js} +8 -8
  136. package/dist/{relay-J3OROVNN.js → relay-YVZM5M6B.js} +5 -5
  137. package/dist/{relay-protocol-UI7QUDOZ.js → relay-protocol-MNWITORT.js} +5 -5
  138. package/dist/{run-cmd-PIMQNBAX.js → run-cmd-MBH5Z2UL.js} +16 -16
  139. package/dist/{runner-agents-KSP3MLAH.js → runner-agents-L3PLYFWJ.js} +4 -4
  140. package/dist/runner-env-IHWYZ3B6.js +24 -0
  141. package/dist/{runner-identity-WZAKGBRX.js → runner-identity-E2XKIJNB.js} +10 -10
  142. package/dist/{runner-key-HGHQYJJX.js → runner-key-3AHJX75Z.js} +47 -47
  143. package/dist/{session-sender-W6MTYKLE.js → session-sender-IS6S7PBC.js} +19 -19
  144. package/dist/{spec-cmd-RJVMWOOX.js → spec-cmd-ZLDYL4N5.js} +17 -17
  145. package/dist/{starter-pack-52PX6IPU.js → starter-pack-XINCCMDN.js} +5 -5
  146. package/dist/state-NIA6XT7D.js +18 -0
  147. package/dist/{status-YQ25OCUL.js → status-GZ7KAIMH.js} +47 -47
  148. package/dist/{sync-cmd-2NBSELL7.js → sync-cmd-3YZ4IB3T.js} +18 -18
  149. package/dist/update-steps-XY46I7FV.js +81 -0
  150. package/dist/{watch-WQGK2SQB.js → watch-LIIODJ5U.js} +18 -18
  151. package/dist/{work-claim-cmd-CQ3DSJBR.js → work-claim-cmd-GWBWIZ43.js} +23 -23
  152. package/dist/work-cmd-CJWTGOU5.js +33 -0
  153. package/dist/work-comment-cmd-RFVCNEET.js +39 -0
  154. package/dist/{work-demo-cmd-BOKSQSA5.js → work-demo-cmd-Q2GKJCVL.js} +16 -16
  155. package/dist/{work-logs-cmd-TZXDF3UI.js → work-logs-cmd-KZQBPU2J.js} +16 -16
  156. package/dist/{work-needs-attention-cmd-WR5GR3B6.js → work-needs-attention-cmd-L3DOYAMK.js} +16 -16
  157. package/dist/{work-no-change-cmd-TKC3V64O.js → work-no-change-cmd-SHP25CJB.js} +16 -16
  158. package/dist/{work-open-pr-cmd-T2IFI7OR.js → work-open-pr-cmd-VATPLVSL.js} +17 -17
  159. package/dist/{work-pr-cmd-WM6PGSGK.js → work-pr-cmd-XBLNONT3.js} +16 -16
  160. package/dist/{work-proofs-cmd-E4VJP55B.js → work-proofs-cmd-T5WZG3CX.js} +18 -18
  161. package/dist/{work-proofs-record-MIVUWECF.js → work-proofs-record-6YF4BS3K.js} +24 -24
  162. package/dist/{work-stop-cmd-52WGVYF5.js → work-stop-cmd-BLOSL24H.js} +16 -16
  163. package/package.json +1 -1
  164. package/skill-pack/maintained/outerlayer-amend/SKILL.md +1 -0
  165. package/skill-pack/maintained/outerlayer-amend/references/attachments.md +23 -0
  166. package/skill-pack/maintained/outerlayer-build/SKILL.md +5 -0
  167. package/skill-pack/maintained/outerlayer-cli/SKILL.md +9 -0
  168. package/dist/agent-setup-F4KAKOQE.js +0 -40
  169. package/dist/caller-LYH64TZB.js +0 -23
  170. package/dist/chunk-SWXAP4GM.js +0 -128
  171. package/dist/find-unit-D7MX5YW7.js +0 -24
  172. package/dist/governing-source-6WWMRJEI.js +0 -41
  173. package/dist/host-checks-KYLKXG2A.js +0 -80
  174. package/dist/host-key-4764FB4U.js +0 -18
  175. package/dist/init-EPBASJNK.js +0 -80
  176. package/dist/loop-VUNIGNXU.js +0 -90
  177. package/dist/machine-2KFSAU27.js +0 -80
  178. package/dist/pending-3FQ3GG6T.js +0 -18
  179. package/dist/runner-env-AMGOE3UI.js +0 -24
  180. package/dist/state-UIV37NXY.js +0 -18
  181. package/dist/update-steps-FH7UXI5N.js +0 -81
  182. package/dist/work-cmd-B32BDBV2.js +0 -33
  183. package/dist/work-comment-cmd-L5FTPUGE.js +0 -38
@@ -1,34 +1,35 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { decideInstalledSwitch } from './chunk-3JVYMD4G.js';
4
- import { reportFailedStart, fitImageBuildMemory } from './chunk-6L55K352.js';
4
+ import { reportFailedStart, fitImageBuildMemory } from './chunk-XFODM3V7.js';
5
5
  import { fetchVersionMeta, npmVersion, npmSupportsProvenance, fetchTarballDigest, fetchProvenance, installVersion, auditSignatures } from './chunk-E7R2GIAW.js';
6
- import { writeFleetState } from './chunk-XLUQC2PE.js';
7
- import { writePendingUpdate } from './chunk-IJWQT2Y7.js';
8
- import { renderUpdateSteps } from './chunk-KGHVJI7V.js';
9
- import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-3QTC4UWC.js';
10
- import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, askFleetMachine } from './chunk-BAWOWJ3G.js';
11
- import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-DPBFNZ6H.js';
12
- import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, releaseLease, runIsolation, runCommandOf, claimRun, itemTag, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, unfinishedJobs, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, listItemDisks, usableCpus, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, parseCpuList, ensureTunnel, keepGhConfigCurrent, filesAreCopied, restartSender, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, vmAlive, writeGuestGhConfig, shellQuote, deliverJobFiles, inTeardown } from './chunk-2YOFSE7U.js';
13
- import { RUNNER_PROTOCOL } from './chunk-RN5VLKZ2.js';
14
- import { RUNNER_RESERVE_BYTES } from './chunk-52IVBUIU.js';
15
- import { RepoFilter } from './chunk-KHC7ICRR.js';
6
+ import { writeFleetState } from './chunk-EHPKACA7.js';
7
+ import { writePendingUpdate } from './chunk-HDEYRLWK.js';
8
+ import { renderUpdateSteps } from './chunk-3W5JLANR.js';
9
+ import { readHousekeepingRecord, writeHousekeepingRecord } from './chunk-YZQYTOCR.js';
10
+ import { fleetConfigProblem, realBlockedProbes, sliceMemoryOf, checkBlockedWithSlots, largeBuildMemoryBytes, LARGE_BUILD_DISK_BYTES, checkManagedRoom, askFleetMachine } from './chunk-TUEEGFAQ.js';
11
+ import { writeMarker, readMarker, currentVersion, removeMarker, isInLayout, startedThroughCurrent, entryIn, versionDir, switchCurrent, cleanVersions, stagingDir } from './chunk-5QFFQCSY.js';
12
+ import { leaseTimeLeftMs, createContainerRuntime, withTunnelLog, itemTag, releaseLease, runIsolation, runCommandOf, claimRun, LEASE_SECONDS, isUnfinished, prepareResume, restoreSessionIntoMicroVm, restoreSessionIntoContainer, recordsProofsOnly, itemScope, attemptNote, fetchManagedClaudeKey, holdManagedClaudeKey, fetchManagedBuildSettings, holdManagedBuildSettings, setStage, jobEnv, runHook, describeHookEnd, needsBuildSkill, provisionContainer, leaseExpiresAtMs, deliverContainerHooks, provisionSandbox, deliverSandboxHooks, provisionMicroVm, deliverCommitHooks, provisionEnvironment, readProvisionOut, resolveHostBuild, workdirProblem, listenOnBroker, hostEnvironment, deliverExecMaven, runWithSpawn, hostCommandEnvironment, lifecycleSteps, execArgv, lifecycleFailureReason, decideHostBuildSkill, prepareBranch, keptCommitsLine, currentSkillCommand, formerSkillProblem, commandLogOffset, startSandboxCommand, MICROVM_COMMAND_DIR, startMicroVmCommand, microVmCommandLine, runCommand, containerCommandExec, execCommandLine, startSender, startHostServices, finishJob, sampleGuest, foldSample, isSandboxTracked, isContainerTracked, isMicroVmTracked, probeSandboxCommand, probeMicroVmCommand, probeCommand, appendCommandLog, judgeProbe, SandboxGoneError, EXIT_CODE_FILE, isTracked, isGroupAlive, outcomeFromExitCode, isIsolatedJob, isTimedOut, readCpuUsec, isIdle, HELPER_ENV, setUpRunnerCgroup, stopOrphanedMicroVms, unfinishedJobs, sweepImageBuilders, listUnreadableJobs, listAdoptableJobs, retryFailedReleases, recoverLostJobs, GUEST_USAGE_INTERVAL_MS, vmAlive, filesAreCopied, listItemDisks, usableCpus, hookLimitsFor, AttemptLogBook, microVmOomKills, needsRenew, renewRun, renewLease, RENEW_INTERVAL_SECONDS, stoppedHelperReason, measureDisk, listTrackedJobs, sweepSandboxes, parseCpuList, ensureTunnel, keepGhConfigCurrent, restartSender, createHousekeepingDocker, housekeepingDockerIfReachable, runHousekeeping, shellQuote, deliverJobFiles, jobRecordsClaim, freeItemDisksUntil, savedStatesDir, readRecords, removeOldestUntil, ensureNetworkReady, managedBuildSettingsFor, ADOPTED_FETCH_RETRY_WINDOW_MS, gitRemoteFor, startServicesFor, installTrust, createLeaseChannel, serveLease, writeGuestGhConfig, inTeardown } from './chunk-WVMKXDOW.js';
13
+ import { RUNNER_PROTOCOL } from './chunk-6XMC6R4W.js';
14
+ import { RUNNER_RESERVE_BYTES } from './chunk-DKDBMMX7.js';
15
+ import { RepoFilter } from './chunk-CXXQQST7.js';
16
16
  import { JOB_STATE_FORMAT, readsJobState, jobStateFormatOf } from './chunk-ZVB57WI6.js';
17
- import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-HT4OKJDB.js';
17
+ import { imageTag, writeUpdateStatus, pullInstruction, tagToPull } from './chunk-2WNJ2MHD.js';
18
18
  import { isVersion, compareVersions, satisfiesRange } from './chunk-TQMI335S.js';
19
- import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls, configForJob } from './chunk-TYLZR7HX.js';
20
- import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-26NMJGEY.js';
19
+ import { claimCalls, claimItem, spoolHomeFor, leftByRunnerKey, runnerCalls, configForJob } from './chunk-MSARYPFD.js';
20
+ import { claimPidFile, releasePidFile, writePidFile, readPidFile } from './chunk-OI4ZV7MJ.js';
21
21
  import { startTimeOf, isSameProcess } from './chunk-JBJTC3UU.js';
22
- import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-MGOEHY72.js';
23
- import { isSignatureRefusal, WorkCommandError, getJson, postJson } from './chunk-QZP3O6IM.js';
24
- import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-WISVAUTD.js';
25
- import { allocatedBytes, freeBytes, formatBytes } from './chunk-7NP5G2FV.js';
26
- import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun } from './chunk-G2J574LS.js';
27
- import { loadHostKey, ensureHostKey, signerFor } from './chunk-JLCEQXQF.js';
28
- import { RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, jobsDir, pidFilePath, storeScopes, imagesDir } from './chunk-O7IJBJ6Z.js';
29
- import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT } from './chunk-UU6FN6PZ.js';
30
- import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-2BMH3373.js';
31
- import { jobAgent, jobCommandEnv, runnerAgents } from './chunk-ZUIHEOSC.js';
22
+ import { describeCallFailure, retrySend, shortClaim, relativeToRunner, formatDuration, resolveGoverningSource, BuildTokens, classifyRefusal, refusalCode, createRunnerLog, formatClock } from './chunk-IVB6A3I7.js';
23
+ import { isSignatureRefusal, WorkCommandError, getJson, postJson, getBytes } from './chunk-B4U5XI4F.js';
24
+ import { keyRunnerFactory, isBuiltinContainer, isBuiltinVm, isBuiltinSandbox, loadRunnerConfig, checkHooks, builtinKind, keepsHostBuilder, runnerDeliversComments, DEFAULT_SAVED_STATE_MAX_BYTES, DEFAULT_UPDATE_MAX_WAIT_HOURS } from './chunk-5QDHJT73.js';
25
+ import { allocatedBytes, freeBytes, formatBytes } from './chunk-RBLXGO5K.js';
26
+ import { writeJobFile, ensureRunnerIdentity, identityDockerFor, readJobFile, exceedsDisk, runnerLabelValue, builderName, ensureFailureCount, builderSpec, ensureBuilder, spawnRun } from './chunk-I2N427GS.js';
27
+ import { loadHostKey, ensureHostKey, signerFor } from './chunk-ENHD5PNW.js';
28
+ import { RUNNER_DIR_MODE, runnerDir, RUNNER_FILE_MODE, buildDir, attemptStamp, jobDir, jobsDir, pidFilePath, storeScopes, imagesDir } from './chunk-AC6DM3S3.js';
29
+ import { parseClaimIdentity, parseClaimedRepositories, parseUnreachable, repositoriesOf, primaryOf, JOB_MOUNT } from './chunk-NE7EG3SN.js';
30
+ import { jobCredentialProblem, COMMAND_LOST_REASON, takeAgentCredentials, heldAgentCredential, CONTAINER_STOPPED_REASON, currentAgentCredential, fdName } from './chunk-WH2QUYXH.js';
31
+ import { cleanAttachmentName } from './chunk-QGUCHNSQ.js';
32
+ import { jobAgent, jobCommandEnv, runnerAgents } from './chunk-UCUBQWJC.js';
32
33
  import { resolveVersion } from './chunk-RA3O54FC.js';
33
34
  import { mkdirSync, existsSync, writeFileSync, chmodSync, renameSync, statSync, readdirSync, readFileSync, rmSync, closeSync } from 'fs';
34
35
  import { join, dirname } from 'path';
@@ -395,6 +396,18 @@ function stopsOf(data) {
395
396
  }
396
397
  return stops;
397
398
  }
399
+ function attachmentsOf(raw) {
400
+ if (!Array.isArray(raw)) return [];
401
+ const out = [];
402
+ for (const entry of raw) {
403
+ const a = entry;
404
+ if (a === null || typeof a !== "object") continue;
405
+ const { id, filename, mediaType, sizeBytes } = a;
406
+ if (typeof id !== "string" || id === "" || typeof filename !== "string" || typeof mediaType !== "string" || typeof sizeBytes !== "number") continue;
407
+ out.push({ id, filename, mediaType, sizeBytes });
408
+ }
409
+ return out;
410
+ }
398
411
  function commentsOf(data) {
399
412
  const raw = data?.comments;
400
413
  if (!Array.isArray(raw)) return [];
@@ -405,7 +418,8 @@ function commentsOf(data) {
405
418
  const { claimId, workItemId, commentId, thread, authorName, text, summary, at } = comment;
406
419
  if (typeof claimId !== "string" || typeof workItemId !== "string" || typeof commentId !== "string" || commentId === "") continue;
407
420
  if (typeof thread !== "string" || typeof authorName !== "string" || typeof text !== "string" || typeof at !== "string") continue;
408
- comments.push({ claimId, workItemId, commentId, thread, authorName, text, summary: typeof summary === "string" ? summary : null, at });
421
+ const attachments = attachmentsOf(comment.attachments);
422
+ comments.push({ claimId, workItemId, commentId, thread, authorName, text, summary: typeof summary === "string" ? summary : null, at, ...attachments.length === 0 ? {} : { attachments } });
409
423
  }
410
424
  return comments;
411
425
  }
@@ -481,6 +495,18 @@ async function sendHeartbeat(args, fetchImpl) {
481
495
  return { ok: false, reason: describeCallFailure(err) };
482
496
  }
483
497
  }
498
+ async function deliverInboxAttachments(runtime, state, files, secrets) {
499
+ try {
500
+ for (const file of files) {
501
+ const target = join(state.buildDir, INBOX_FOLDER, file.path);
502
+ mkdirSync(dirname(target), { recursive: true, mode: 493 });
503
+ writeFileSync(target, file.bytes, { mode: 420 });
504
+ }
505
+ } catch (err) {
506
+ return { ok: false, reason: `the attachments for the agent could not be written on the host: ${err instanceof Error ? err.message : String(err)}` };
507
+ }
508
+ return deliverJobFiles(runtime, state, ["inbox"], secrets);
509
+ }
484
510
  async function deliverInboxFile(runtime, state, file, secrets) {
485
511
  const folder = join(state.buildDir, INBOX_FOLDER);
486
512
  try {
@@ -494,6 +520,24 @@ async function deliverInboxFile(runtime, state, file, secrets) {
494
520
 
495
521
  // src/runner/microvm/inbox.ts
496
522
  var ROOT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin";
523
+ async function writeGuestInboxAttachment(runtime, state, relativePath, bytes) {
524
+ const target = `${JOB_MOUNT}/${INBOX_FOLDER}/${relativePath}`;
525
+ const folder = target.slice(0, target.lastIndexOf("/"));
526
+ const partial = `${folder}/.${target.slice(folder.length + 1)}.partial`;
527
+ const script2 = [
528
+ "set -e",
529
+ "umask 022",
530
+ `mkdir -p ${shellQuote(folder)}`,
531
+ `base64 -d > ${shellQuote(partial)}`,
532
+ `chmod 0644 ${shellQuote(partial)}`,
533
+ `mv ${shellQuote(partial)} ${shellQuote(target)}`
534
+ ].join("\n");
535
+ const result = await runtime.vm.exec(state.vsockPath, { argv: ["/bin/sh", "-c", script2], user: "root", cwd: "/", env: { PATH: ROOT_PATH } }, { stdin: Buffer.from(bytes).toString("base64") });
536
+ if (result.status !== 0) {
537
+ const line = result.stderr.trim().split("\n")[0] ?? "";
538
+ throw new Error(`writing an attachment into the guest's inbox failed (exit ${result.status})${line === "" ? "" : `: ${line}`}`);
539
+ }
540
+ }
497
541
  async function writeGuestInboxFile(runtime, state, file) {
498
542
  const folder = `${JOB_MOUNT}/${INBOX_FOLDER}`;
499
543
  const partial = shellQuote(`${folder}/.${file.id}.partial`);
@@ -525,22 +569,84 @@ function inboxFileOf(comment, job) {
525
569
  authorName: comment.authorName,
526
570
  text: comment.text,
527
571
  summary: comment.summary,
528
- at: comment.at
572
+ at: comment.at,
573
+ ...comment.attachments === void 0 || comment.attachments.length === 0 ? {} : {
574
+ attachments: comment.attachments.map((attachment, position) => {
575
+ const filename = cleanAttachmentName(attachment.filename);
576
+ return {
577
+ id: attachment.id,
578
+ path: `attachments/${comment.commentId}/${position}-${filename}`,
579
+ filename,
580
+ mediaType: attachment.mediaType,
581
+ sizeBytes: attachment.sizeBytes,
582
+ missing: false
583
+ };
584
+ })
585
+ }
529
586
  };
530
587
  }
531
- async function deliverComment(runtime, job, file, secrets) {
588
+ async function deliverComment(runtime, job, file, secrets, fetchAttachment) {
532
589
  if (job.microvm !== void 0) {
533
- if (!vmAlive(runtime, job.microvm)) return { ok: false, reason: "the build's microVM is not running" };
590
+ const state = job.microvm;
591
+ if (!vmAlive(runtime, state)) return { ok: false, reason: "the build's microVM is not running" };
534
592
  try {
535
- await writeGuestInboxFile(runtime, job.microvm, file);
593
+ const placed = await placeAttachments(file, fetchAttachment, (attachment, bytes) => writeGuestInboxAttachment(runtime, state, attachment.path, bytes));
594
+ await writeGuestInboxFile(runtime, state, placed);
536
595
  return { ok: true };
537
596
  } catch (err) {
538
597
  return { ok: false, reason: err instanceof Error ? err.message : String(err) };
539
598
  }
540
599
  }
541
- if (job.container !== void 0 && filesAreCopied(job.container)) return deliverInboxFile(runtime, job.container, file, secrets);
600
+ if (job.container !== void 0 && filesAreCopied(job.container)) {
601
+ const pending = [];
602
+ const placed = await placeAttachments(file, fetchAttachment, async (attachment, bytes) => {
603
+ pending.push({ path: attachment.path, bytes });
604
+ });
605
+ if (pending.length > 0) {
606
+ const copied = await deliverInboxAttachments(runtime, job.container, pending, secrets);
607
+ if (!copied.ok) return copied;
608
+ }
609
+ return deliverInboxFile(runtime, job.container, placed, secrets);
610
+ }
542
611
  return { ok: true, skipped: true };
543
612
  }
613
+ async function placeAttachments(file, fetchAttachment, write) {
614
+ if (file.attachments === void 0) return file;
615
+ const attachments = [];
616
+ for (const attachment of file.attachments) {
617
+ const bytes = fetchAttachment === void 0 ? void 0 : await fetchAttachment(attachment).catch(() => void 0);
618
+ if (bytes === void 0) {
619
+ attachments.push({ ...attachment, missing: true });
620
+ continue;
621
+ }
622
+ try {
623
+ await write(attachment, bytes);
624
+ } catch {
625
+ attachments.push({ ...attachment, missing: true });
626
+ continue;
627
+ }
628
+ attachments.push({ ...attachment, missing: false });
629
+ }
630
+ return { ...file, attachments };
631
+ }
632
+
633
+ // src/runner/attachments.ts
634
+ var ATTACHMENT_DOWNLOAD_TRIES = 3;
635
+ var RETRY_DELAY_MS = 500;
636
+ var DOWNLOAD_TIMEOUT_MS = 6e4;
637
+ async function downloadAttachment(calls, attachment, fetchImpl, sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms))) {
638
+ const path = `/v1/work-items/${encodeURIComponent(String(calls.item))}/attachments/${encodeURIComponent(attachment.id)}`;
639
+ for (let attempt = 1; attempt <= ATTACHMENT_DOWNLOAD_TRIES; attempt++) {
640
+ try {
641
+ const signer = await signerFor(calls.configPath);
642
+ const got = await getBytes(calls.url, path, calls.apiKey, calls.appId, fetchImpl, signer, { timeoutMs: DOWNLOAD_TIMEOUT_MS });
643
+ return got.bytes;
644
+ } catch {
645
+ if (attempt < ATTACHMENT_DOWNLOAD_TRIES) await sleep(RETRY_DELAY_MS);
646
+ }
647
+ }
648
+ return void 0;
649
+ }
544
650
 
545
651
  // src/runner/host-state.ts
546
652
  function hostState(flags) {
@@ -1491,7 +1597,19 @@ function applyComments(state, comments) {
1491
1597
  delivering.add(comment.commentId);
1492
1598
  const key = `comment ${comment.commentId} for the agent`;
1493
1599
  const runtime = runtimeOf(state);
1494
- void deliverComment(runtime, active.job, file, () => runtime.credentials.get(active.dirPath)?.issuedTokens() ?? []).then((result) => {
1600
+ const fetchAttachment = (attachment) => {
1601
+ try {
1602
+ const calls = claimCalls(state.config, active.job);
1603
+ return downloadAttachment(
1604
+ { url: calls.url, apiKey: calls.apiKey, appId: calls.appId, configPath: calls.configPath, item: claimItem(state.config, active.job) },
1605
+ attachment,
1606
+ state.deps.fetchImpl
1607
+ );
1608
+ } catch {
1609
+ return Promise.resolve(void 0);
1610
+ }
1611
+ };
1612
+ void deliverComment(runtime, active.job, file, () => runtime.credentials.get(active.dirPath)?.issuedTokens() ?? [], fetchAttachment).then((result) => {
1495
1613
  if (result.ok) delivered.add(comment.commentId);
1496
1614
  reportRepeating(state, key, result.ok ? void 0 : `${itemTag(active.job)} the ${key} could not be written into the build: ${result.reason}`);
1497
1615
  }).catch((err) => reportRepeating(state, key, `${itemTag(active.job)} the ${key} could not be written into the build: ${describeCallFailure(err)}`)).finally(() => delivering.delete(comment.commentId));
@@ -2397,7 +2515,7 @@ var CLAIM_REFUSAL_CODES = new Set(
2397
2515
  "pull_request_from_fork pull_request_on_default_branch pull_request_ambiguous pull_request_repository_not_connected repository_not_reachable branch_claimed_elsewhere".split(" ")
2398
2516
  );
2399
2517
  async function tryClaimAndStart(state, item, queue) {
2400
- const { postJson: postJson2 } = await import('./work-cmd-B32BDBV2.js');
2518
+ const { postJson: postJson2 } = await import('./work-cmd-CJWTGOU5.js');
2401
2519
  const log = logOf(state);
2402
2520
  const hostKey = await loadHostKey(state.config.configPath);
2403
2521
  const claim = await retrySend(
@@ -3859,7 +3977,7 @@ async function startRunner(configPath, deps, startup) {
3859
3977
  check: update.check ? () => update.check(configPath) : async () => {
3860
3978
  const held = runnerAgents(deps.agents).flatMap((agent) => heldAgentCredential(agent.descriptor.id) ?? []);
3861
3979
  const env = { ...process.env, ...Object.fromEntries(held.map((credential) => [credential.variable, credential.value])) };
3862
- return (await import('./check-DBYJIP44.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3980
+ return (await import('./check-SJCTNS7N.js')).runRunnerCheck(configPath, { fetchImpl: deps.fetchImpl, env });
3863
3981
  },
3864
3982
  now: () => (deps.now ?? (() => /* @__PURE__ */ new Date()))().getTime(),
3865
3983
  log
@@ -4243,4 +4361,4 @@ function runnerProcessState(configPath) {
4243
4361
  return isSameProcess(entry.pid, entry.start) ? { state: "running", pid: entry.pid } : { state: "stale", pid: entry.pid };
4244
4362
  }
4245
4363
 
4246
- export { LAPSED_REASON, RunnerStartError, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, prepareSession, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
4364
+ export { LAPSED_REASON, RunnerStartError, applyComments, fleetKeepalive, leaseTimeLeftFor, listJobFiles, logUnusableHelper, prepareSession, probeBuild, probeCredentials, requestStop, runnerProcessState, runtimeOf, sampleUsage, start, tick, watchTick };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-7NP5G2FV.js';
4
- import { parseSize } from './chunk-G2J574LS.js';
5
- import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-UU6FN6PZ.js';
6
- import { builderDiskPinned } from './chunk-ZUIHEOSC.js';
3
+ import { DEFAULT_CACHE_DISK, DEFAULT_BUILD_DISK } from './chunk-RBLXGO5K.js';
4
+ import { parseSize } from './chunk-I2N427GS.js';
5
+ import { isRefusedInConfig, resolveDestinations, isReservedVariable } from './chunk-NE7EG3SN.js';
6
+ import { builderDiskPinned } from './chunk-UCUBQWJC.js';
7
7
  import { homeFromEnv } from './chunk-352DHUTP.js';
8
8
  import { existsSync, statSync, accessSync, constants, readFileSync } from 'fs';
9
9
  import { hostname } from 'os';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-O7IJBJ6Z.js';
3
+ import { runnerDir, RUNNER_DIR_MODE, RUNNER_FILE_MODE } from './chunk-AC6DM3S3.js';
4
4
  import { readlinkSync, realpathSync, mkdirSync, unlinkSync, symlinkSync, renameSync, readFileSync, writeFileSync, rmSync, existsSync, readdirSync } from 'fs';
5
5
  import { join, basename, sep, resolve } from 'path';
6
6
 
@@ -2,8 +2,8 @@
2
2
  import { createRequire } from 'node:module';
3
3
  import { C } from './chunk-2AM6Z5BP.js';
4
4
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
5
- import { linkedAgentsPath } from './chunk-XPXJWIOJ.js';
6
- import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-3Q2SEOT3.js';
5
+ import { linkedAgentsPath } from './chunk-ITOIM3WV.js';
6
+ import { resolvePackRoot, OUTERLAYER_SKILLS_BASE, loadTemplateFiles, AGENTS_SKILLS_BASE, loadMaintainedFiles, rewriteSkillPaths, TEMPLATE_SKILLS, skillDir, writeMaintainedFiles, MACHINE_SKILL_PATH } from './chunk-MT4XF5OL.js';
7
7
  import { LEGACY_AGENT } from './chunk-7PZDPISM.js';
8
8
  import { MAINTAINED_SKILLS } from './chunk-ATEMEVFF.js';
9
9
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
@@ -4,6 +4,6 @@ import { createRequire } from 'node:module';
4
4
  createRequire(import.meta.url);
5
5
 
6
6
  // src/runner/protocol.ts
7
- var RUNNER_PROTOCOL = 48;
7
+ var RUNNER_PROTOCOL = 49;
8
8
 
9
9
  export { RUNNER_PROTOCOL };
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-C2PZOLN7.js';
4
- import { detectActiveSession } from './chunk-F4XMG7EO.js';
5
- import { autoConnect } from './chunk-IPB5UOHH.js';
6
- import { acquireSpoolLockAt } from './chunk-2DVQHK37.js';
4
+ import { detectActiveSession } from './chunk-SBPMDO47.js';
5
+ import { autoConnect } from './chunk-XFU37HIM.js';
6
+ import { acquireSpoolLockAt } from './chunk-B5Z4VA4Q.js';
7
7
  import { C } from './chunk-2AM6Z5BP.js';
8
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6ZMFEZ2K.js';
8
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-VRWZNI6U.js';
9
9
  import { launchedItemForSession } from './chunk-LGJ56FCM.js';
10
10
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
11
11
  import { homeFromEnv } from './chunk-352DHUTP.js';
12
- import { resolveRepoIdentity } from './chunk-N2QYP3NQ.js';
13
- import { StepNameSchema, StepBodySchema } from './chunk-HE53NIRE.js';
12
+ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
13
+ import { StepNameSchema, StepBodySchema } from './chunk-FXVHF6RX.js';
14
14
  import { randomUUID } from 'crypto';
15
15
  import { readFileSync, existsSync, mkdirSync, writeFileSync, renameSync, appendFileSync } from 'fs';
16
16
  import { join, dirname } from 'path';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { PROXY_WARNING_FLAG } from './chunk-UU6FN6PZ.js';
4
- import { RELAY_ID, RELAY_USER } from './chunk-2BMH3373.js';
5
- import { imageInstalls, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-ZUIHEOSC.js';
6
- import { defaultAgents } from './chunk-3Q2SEOT3.js';
3
+ import { PROXY_WARNING_FLAG } from './chunk-NE7EG3SN.js';
4
+ import { RELAY_ID, RELAY_USER } from './chunk-WH2QUYXH.js';
5
+ import { imageInstalls, GH_VERSION, VOICE_PACK_FILES, VOICE_PACK_VERSION, FFMPEG_STATIC, FFMPEG_BUILD_TAG, GH_SHA256, TINI_SHA256, TINI_VERSION, HEADLESS_SHELL_REVISION, HEADLESS_SHELL_BASE_URL, PLAYWRIGHT_FFMPEG_BASE_URL, PLAYWRIGHT_FFMPEG_REVISION, HEADLESS_SHELL, PLAYWRIGHT_FFMPEG, PLAYWRIGHT_VERSION } from './chunk-UCUBQWJC.js';
6
+ import { defaultAgents } from './chunk-MT4XF5OL.js';
7
7
 
8
8
  createRequire(import.meta.url);
9
9
 
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { launchRefusalForSession } from './chunk-C2PZOLN7.js';
4
- import { detectActiveSession } from './chunk-F4XMG7EO.js';
5
- import { autoConnect } from './chunk-IPB5UOHH.js';
4
+ import { detectActiveSession } from './chunk-SBPMDO47.js';
5
+ import { autoConnect } from './chunk-XFU37HIM.js';
6
6
  import { C } from './chunk-2AM6Z5BP.js';
7
- import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-6ZMFEZ2K.js';
7
+ import { resolveGatewayCredentials, defaultFetch, unauthorizedMessage } from './chunk-VRWZNI6U.js';
8
8
  import { launchedItemForSession } from './chunk-LGJ56FCM.js';
9
9
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
10
10
  import { homeFromEnv } from './chunk-352DHUTP.js';
11
- import { resolveRepoIdentity } from './chunk-N2QYP3NQ.js';
12
- import { CriteriaListSchema } from './chunk-HE53NIRE.js';
11
+ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
12
+ import { CriteriaListSchema } from './chunk-FXVHF6RX.js';
13
13
  import { readFileSync } from 'fs';
14
14
 
15
15
  createRequire(import.meta.url);
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { defaultAgents, laptopAgents, contextAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-3Q2SEOT3.js';
3
+ import { defaultAgents, laptopAgents, contextAgents, userSkillFolderIn, loadMachineSkillFiles, resolvePackRoot } from './chunk-MT4XF5OL.js';
4
4
  import { MAINTAINED_SKILLS, maintainedLineVersion } from './chunk-ATEMEVFF.js';
5
5
  import { resolvePackageVersion } from './chunk-RA3O54FC.js';
6
6
  import { homeFromEnv } from './chunk-352DHUTP.js';
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { BUILD_HOME } from './chunk-UU6FN6PZ.js';
3
+ import { BUILD_HOME } from './chunk-NE7EG3SN.js';
4
4
  import { readdirSync } from 'fs';
5
5
  import { join, dirname } from 'path';
6
6
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { RemovedTargetError, removedTargetError } from './chunk-ZZ4AX25R.js';
4
- import { removeRetiredSkills } from './chunk-HITUWIB7.js';
5
- import { defaultFetch, resolveGatewayCredentials } from './chunk-6ZMFEZ2K.js';
6
- import { withTokenHeader } from './chunk-UU6FN6PZ.js';
3
+ import { RemovedTargetError, removedTargetError } from './chunk-OWEJP5HJ.js';
4
+ import { removeRetiredSkills } from './chunk-TW2V2IQ4.js';
5
+ import { defaultFetch, resolveGatewayCredentials } from './chunk-VRWZNI6U.js';
6
+ import { withTokenHeader } from './chunk-NE7EG3SN.js';
7
7
  import { appendContextProvenance } from './chunk-545P7JY7.js';
8
8
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
9
9
  import { writeDegraded, writeSourceCache, SOURCE_CACHE_TTL_RETRY_MS, writeContextManifest, SOURCE_CACHE_TTL_SUCCESS_MS, readSourceCache, isSourceCacheFresh, clearDegraded } from './chunk-YQR6E6OV.js';
10
- import { normalizeRepoName, loadMaintainedFiles, writeMaintainedFiles, parseOuterlayerConfig, targetIds, classifyTree, emitTree, emitBuilders, defaultAgents, agentRootFolders } from './chunk-3Q2SEOT3.js';
10
+ import { normalizeRepoName, loadMaintainedFiles, writeMaintainedFiles, parseOuterlayerConfig, targetIds, classifyTree, emitTree, emitBuilders, defaultAgents, agentRootFolders } from './chunk-MT4XF5OL.js';
11
11
  import { homeFromEnv } from './chunk-352DHUTP.js';
12
12
  import { execFileSync } from 'child_process';
13
13
  import { existsSync, mkdirSync, writeFileSync, chmodSync, lstatSync, readFileSync, copyFileSync } from 'fs';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { helperSocketPath } from './chunk-2YOFSE7U.js';
4
- import { UNIT_MARKER } from './chunk-52IVBUIU.js';
5
- import { runnerDir } from './chunk-O7IJBJ6Z.js';
3
+ import { helperSocketPath } from './chunk-WVMKXDOW.js';
4
+ import { UNIT_MARKER } from './chunk-DKDBMMX7.js';
5
+ import { runnerDir } from './chunk-AC6DM3S3.js';
6
6
  import { createHash } from 'crypto';
7
7
  import { join } from 'path';
8
8
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { currentLink } from './chunk-DPBFNZ6H.js';
3
+ import { currentLink } from './chunk-5QFFQCSY.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';
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { detectActiveSession } from './chunk-F4XMG7EO.js';
4
- import { autoConnect } from './chunk-IPB5UOHH.js';
5
- import { workPageUrl } from './chunk-ZRTGX4GN.js';
6
- import { sanitizeTerminal } from './chunk-2DVQHK37.js';
3
+ import { detectActiveSession } from './chunk-SBPMDO47.js';
4
+ import { autoConnect } from './chunk-XFU37HIM.js';
5
+ import { workPageUrl } from './chunk-QFQ2UNZU.js';
6
+ import { sanitizeTerminal } from './chunk-B5Z4VA4Q.js';
7
7
  import { C } from './chunk-2AM6Z5BP.js';
8
- import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-6ZMFEZ2K.js';
9
- import { signRunnerRequest } from './chunk-JLCEQXQF.js';
8
+ import { resolveGatewayCredentials, unauthorizedMessage, defaultFetch } from './chunk-VRWZNI6U.js';
9
+ import { signRunnerRequest } from './chunk-ENHD5PNW.js';
10
10
  import { readRepoConnection } from './chunk-BJ3KTMDH.js';
11
11
  import { parseTrackerNumber, trackerNumberError } from './chunk-WZBHBH3J.js';
12
12
  import { NATIVE_AGENTS, LEGACY_AGENT } from './chunk-7PZDPISM.js';
13
13
  import { homeFromEnv } from './chunk-352DHUTP.js';
14
- import { resolveRepoIdentity } from './chunk-N2QYP3NQ.js';
14
+ import { resolveRepoIdentity } from './chunk-MBPBYMHU.js';
15
15
 
16
16
  createRequire(import.meta.url);
17
17
 
@@ -320,6 +320,66 @@ async function getJson(url, path, apiKey, appId, fetchImpl, signer, limits) {
320
320
  }
321
321
  return { status: response.status, data: json.data ?? json, pagination: json.pagination ?? null };
322
322
  }
323
+ var RateLimitedError = class extends WorkCommandError {
324
+ constructor(message, retryAfterSeconds) {
325
+ super(message, true, 429, "rate_limited");
326
+ this.retryAfterSeconds = retryAfterSeconds;
327
+ }
328
+ };
329
+ async function refusalOfBytesCall(response, apiKey, endpoint) {
330
+ if (response.status === 401) return await signatureRefusalOf(response) ?? new WorkCommandError(unauthorizedMessage(apiKey), false, 401);
331
+ let error;
332
+ let parsed = true;
333
+ try {
334
+ error = (await response.json()).error;
335
+ } catch {
336
+ parsed = false;
337
+ }
338
+ if (response.status === 429) {
339
+ const header = Number(response.headers.get("retry-after"));
340
+ return new RateLimitedError(error?.message ?? "rate limited", Number.isFinite(header) && header > 0 ? header : void 0);
341
+ }
342
+ if (!parsed) return new WorkCommandError(`${endpoint} answered ${response.status} with a body that is not JSON`, response.status >= 500, response.status);
343
+ return new WorkCommandError(error?.message ?? `request failed (${response.status})`, response.status >= 500, response.status, error?.code);
344
+ }
345
+ async function postBytes(url, path, apiKey, appId, bytes, headers, fetchImpl, signer) {
346
+ const endpoint = new URL(path, url).toString();
347
+ const signature = signer === void 0 ? {} : { ...await signRunnerRequest({ method: "POST", url: endpoint, body: bytes, signer }) };
348
+ let response;
349
+ try {
350
+ response = await fetchImpl(endpoint, {
351
+ method: "POST",
352
+ headers: { authorization: `Bearer ${apiKey}`, "x-outerlayer-app-id": appId, ...headers, ...signature },
353
+ body: Buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength)
354
+ });
355
+ } catch (err) {
356
+ throw new WorkCommandError(`network error reaching ${endpoint}: ${String(err)}`, true);
357
+ }
358
+ if (!response.ok) throw await refusalOfBytesCall(response, apiKey, endpoint);
359
+ let json;
360
+ try {
361
+ json = await response.json();
362
+ } catch {
363
+ throw new WorkCommandError(`${endpoint} answered ${response.status} with a body that is not JSON \u2014 the request may not have reached the gateway`, true, response.status);
364
+ }
365
+ return { status: response.status, data: json.data ?? json };
366
+ }
367
+ async function getBytes(url, path, apiKey, appId, fetchImpl, signer, limits) {
368
+ const endpoint = new URL(path, url).toString();
369
+ const signature = await signatureHeaders("GET", endpoint, "", signer);
370
+ let response;
371
+ try {
372
+ response = await fetchImpl(endpoint, {
373
+ method: "GET",
374
+ headers: { authorization: `Bearer ${apiKey}`, "x-outerlayer-app-id": appId, ...signature },
375
+ ...limits?.timeoutMs === void 0 ? {} : { signal: AbortSignal.timeout(limits.timeoutMs) }
376
+ });
377
+ } catch (err) {
378
+ throw new WorkCommandError(`network error reaching ${endpoint}: ${String(err)}`, true);
379
+ }
380
+ if (!response.ok) throw await refusalOfBytesCall(response, apiKey, endpoint);
381
+ return { status: response.status, bytes: new Uint8Array(await response.arrayBuffer()), mediaType: response.headers.get("content-type") ?? "application/octet-stream", disposition: response.headers.get("content-disposition") };
382
+ }
323
383
  async function findLiveItem(creds, repository, subject, fetchImpl) {
324
384
  const query = new URLSearchParams({ repository, issue: String(subject.issue) });
325
385
  const page = await getJson(
@@ -486,7 +546,7 @@ async function runWorkLinkSession(opts) {
486
546
  return await linkSession(opts);
487
547
  } catch (err) {
488
548
  if (opts.logFailures) {
489
- const { logHookError } = await import('./hook-fast-OFCB6O5N.js');
549
+ const { logHookError } = await import('./hook-fast-ECQBMESE.js');
490
550
  const reason = err instanceof Error ? err.message : String(err);
491
551
  logHookError(opts.home ?? homeFromEnv(opts.env ?? process.env), new Error(`work link-session #${opts.number} failed: ${reason}`));
492
552
  }
@@ -694,4 +754,4 @@ async function runWorkList(opts) {
694
754
  return { data, output };
695
755
  }
696
756
 
697
- export { TRACKERS, WorkCommandError, environmentFacts, findLiveItemForIssue, getJson, isSignatureRefusal, parsePositiveInt, patchJson, postJson, resolveCredentials, runWorkBuild, runWorkLinkSession, runWorkList, runWorkRemove, runWorkStatus, signatureRefusalMessage, verifiedTrackerNames };
757
+ export { RateLimitedError, TRACKERS, WorkCommandError, environmentFacts, findLiveItemForIssue, getBytes, getJson, isSignatureRefusal, parsePositiveInt, patchJson, postBytes, postJson, resolveCredentials, runWorkBuild, runWorkLinkSession, runWorkList, runWorkRemove, runWorkStatus, signatureRefusalMessage, verifiedTrackerNames };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
3
  import { homeFromEnv } from './chunk-352DHUTP.js';
4
- import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-HE53NIRE.js';
4
+ import { ArtifactTombstoneRecordSchema, ArtifactSpoolRecordSchema } from './chunk-FXVHF6RX.js';
5
5
  import { mkdirSync, appendFileSync, writeFileSync, renameSync, unlinkSync, existsSync, readdirSync, readFileSync, statSync } from 'fs';
6
6
  import { join, dirname } from 'path';
7
7
 
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { sanitizeTerminal } from './chunk-2DVQHK37.js';
4
- import { resolvePackRoot, parseProofsConfig } from './chunk-3Q2SEOT3.js';
5
- import { CHECK_ITEM_REASON_MAX_LENGTH, CHECK_ITEMS_MAX, CheckItemsSchema, CHECK_ITEM_REFS_MAX, CHECK_ITEM_ID_MAX_LENGTH, CHECK_ITEM_REF_PATH_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID } from './chunk-HE53NIRE.js';
3
+ import { sanitizeTerminal } from './chunk-B5Z4VA4Q.js';
4
+ import { resolvePackRoot, parseProofsConfig } from './chunk-MT4XF5OL.js';
5
+ import { CHECK_ITEM_REASON_MAX_LENGTH, CHECK_ITEMS_MAX, CheckItemsSchema, CHECK_ITEM_REFS_MAX, CHECK_ITEM_ID_MAX_LENGTH, CHECK_ITEM_REF_PATH_MAX_LENGTH, JUDGE_NOT_RUN_ITEM_ID, REVIEWED_COMMIT_ITEM_ID } from './chunk-FXVHF6RX.js';
6
6
  import { createHash } from 'crypto';
7
7
  import { join } from 'path';
8
8
  import { pathToFileURL } from 'url';
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-FLIRUHVT.js';
4
- import { VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH, POLICY_CONTENT } from './chunk-P43BSQGV.js';
5
- import { skillsBaseFor } from './chunk-C7YFAPMY.js';
3
+ import { mcpTargetPath, INIT_STDIO_ENTRY, INIT_DOCS_ENTRY, DOCS_MCP_SERVER_NAME } from './chunk-TUSIYONR.js';
4
+ import { VALIDATOR_FILES, VALIDATORS_DIR, POLICY_PATH, POLICY_CONTENT } from './chunk-6RQP5GP5.js';
5
+ import { skillsBaseFor } from './chunk-YO2NPS66.js';
6
6
  import { findGitDirs } from './chunk-BJ3KTMDH.js';
7
7
  import { cliInvocation } from './chunk-FZKNTIOJ.js';
8
- import { hasSymlinkComponent } from './chunk-XPXJWIOJ.js';
8
+ import { hasSymlinkComponent } from './chunk-ITOIM3WV.js';
9
9
  import { cloneIsGoverned } from './chunk-YQR6E6OV.js';
10
- import { resolvePackRoot, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, restoreSkillPaths, rewriteSkillPaths, skillDir, loadTemplateFiles, TEMPLATE_SKILLS } from './chunk-3Q2SEOT3.js';
10
+ import { resolvePackRoot, AGENTS_SKILLS_BASE, OUTERLAYER_SKILLS_BASE, restoreSkillPaths, rewriteSkillPaths, skillDir, loadTemplateFiles, TEMPLATE_SKILLS } from './chunk-MT4XF5OL.js';
11
11
  import { createHash } from 'crypto';
12
12
  import { existsSync, readFileSync } from 'fs';
13
13
  import { join } from 'path';
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';
3
- import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-OQHHPJNK.js';
4
- import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-DPBFNZ6H.js';
3
+ import { launcherPath, pathNotes, writeLauncher, LauncherWriteError } from './chunk-ATQHPT3B.js';
4
+ import { currentVersion, currentLink, versionDir, execStartLine, isInLayout, packageRootIn, switchCurrent } from './chunk-5QFFQCSY.js';
5
5
  import { compareVersions } from './chunk-TQMI335S.js';
6
- import { runnerDir, RUNNER_DIR_MODE } from './chunk-O7IJBJ6Z.js';
6
+ import { runnerDir, RUNNER_DIR_MODE } from './chunk-AC6DM3S3.js';
7
7
  import { lchownSync, lstatSync, realpathSync, readFileSync, mkdirSync, rmSync, cpSync, existsSync, readdirSync } from 'fs';
8
8
  import { dirname, sep, join } from 'path';
9
9
  import { spawnSync } from 'child_process';