stim 1.20.2 → 1.22.0

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 (231) hide show
  1. package/README.md +141 -8
  2. package/dist/acquire-artifact-Co2k4f7O.mjs +171 -0
  3. package/dist/act-DsuqEkiM.mjs +2801 -0
  4. package/dist/activity-CMLmzp7o.mjs +1397 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-DUFaTMdd.mjs} +23 -67
  6. package/dist/{android-DCKZrNvV.mjs → android-ByRMUoiJ.mjs} +157 -93
  7. package/dist/{android-Mz_Inn3w.mjs → android-C7sVmyI9.mjs} +299 -116
  8. package/dist/{android-Dlzxshgp.mjs → android-DGkNqa_c.mjs} +5 -5
  9. package/dist/{android-HqP1_vB_.mjs → android-DR5lZ2Az.mjs} +2 -2
  10. package/dist/android-cas-compiler.mjs +2 -2
  11. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-ngferVq2.mjs} +7 -6
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/android-project-DVWyCbWU.d.mts +391 -0
  14. package/dist/api.d.mts +810 -64
  15. package/dist/api.mjs +782 -1
  16. package/dist/{artifact-HSwkIWEQ.mjs → artifact-8EY8SAPw.mjs} +240 -213
  17. package/dist/{artifact-D3czlUvT.mjs → artifact-DJPy518Y.mjs} +203 -164
  18. package/dist/artifact-platform-CXcmX_j3.mjs +27 -0
  19. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-Bcv99PBM.mjs} +194 -64
  20. package/dist/budget-Cvwn54qV.mjs +9285 -0
  21. package/dist/{build-DYDbfkk5.mjs → build-CabC3G23.mjs} +153 -98
  22. package/dist/build-cache-Dv7RN200.mjs +602 -0
  23. package/dist/build-plan-DUC8Ka9y.mjs +248 -0
  24. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DSeQjt-Q.mjs} +2 -2
  25. package/dist/cache-manifest.mjs +1 -1
  26. package/dist/{ccache-zdKiYQ3E.mjs → ccache-Btwc36-I.mjs} +10 -9
  27. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-3fwICjzi.mjs} +18 -5
  28. package/dist/{chrome-BnzZMqsR.mjs → chrome-Bbw689-6.mjs} +7 -4
  29. package/dist/{cli-CLP3diBm.mjs → cli-CHZa9Lvk.mjs} +20 -20
  30. package/dist/cli.mjs +1 -1
  31. package/dist/client-OyRoEuSr.mjs +1577 -0
  32. package/dist/collector-run.d.mts +4 -40
  33. package/dist/collector-run.mjs +9 -8
  34. package/dist/{command-output-BTy8hZ0F.mjs → command-output-gwpm28fu.mjs} +1 -1
  35. package/dist/config-DlrsduwG.mjs +955 -0
  36. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-x9rN6bhs.mjs} +14 -4
  37. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-1I9KZT1Y.mjs} +20 -5
  38. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-BwNEtIrP.mjs} +1 -1
  39. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-BSDR5h3F.mjs} +2 -2
  40. package/dist/{device-BECOiufl.mjs → device-B-L3Fbxy.mjs} +91 -34
  41. package/dist/device-DklWZLqb.mjs +1068 -0
  42. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-DK5_EwRS.mjs} +42 -13
  43. package/dist/device-host-worker.mjs +76 -79
  44. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DoB6KFCO.mjs} +77 -51
  45. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-xJPQ_QQG.mjs} +14 -26
  46. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-BMkdsefq.mjs} +5 -5
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-Bo7BXLux.mjs} +271 -320
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-D5_EzwfA.mjs} +186 -91
  49. package/dist/doctor-fingerprint-DZLoYFVb.mjs +16 -0
  50. package/dist/doctor-fingerprint.mjs +19 -0
  51. package/dist/doctor-thjWAV0z.mjs +2 -0
  52. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-N2wDotwQ.mjs} +40 -21
  53. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-CwknaQYj.mjs} +53 -20
  54. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-CSgAulr5.mjs} +41 -214
  55. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-DlY_serQ.mjs} +230 -11
  56. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-DBWO2rxE.mjs} +172 -82
  57. package/dist/exec-DEoAhcze.mjs +858 -0
  58. package/dist/exec-DnYc4HGH.d.mts +78 -0
  59. package/dist/{gc-qWOMdnER.mjs → gc-CXxN-4SE.mjs} +1091 -1029
  60. package/dist/gc-DnNDQyaP.mjs +3 -0
  61. package/dist/{guide-G9cAbVAc.mjs → guide-Br0LEfKy.mjs} +1165 -297
  62. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-B-9f-jkd.mjs} +10 -8
  63. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DZAPrcro.mjs} +34 -19
  64. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CsCS21hn.mjs} +1 -1
  65. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-FIRx9X2f.mjs} +77 -43
  66. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-_awYSpfv.mjs} +35 -22
  67. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-BdzE668-.mjs} +49 -27
  68. package/dist/idle-C4cZ757K.d.mts +24 -0
  69. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DDg3SdvY.mjs} +11 -10
  70. package/dist/ios-CDvlmUs7.d.mts +24 -0
  71. package/dist/{ios-BwVCF7oA.mjs → ios-Ds1clbIt.mjs} +8 -8
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device--h_-8ENa.mjs} +51 -26
  73. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-BXZ0c7Kb.mjs} +1 -1
  74. package/dist/{ios-RkW4pnQf.mjs → ios-hcBpnEGk.mjs} +200 -93
  75. package/dist/{ios-Ce7bc7br.mjs → ios-pm4nL6By.mjs} +160 -108
  76. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-CZhKODF3.mjs} +13 -13
  77. package/dist/ios-signing-BtAffm0A.mjs +489 -0
  78. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-Dtw5K2aI.mjs} +1 -1
  79. package/dist/{ios-nOLJGVdy.mjs → ios-xtlRHaeB.mjs} +1 -1
  80. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Bwhh4S7V.mjs} +30 -25
  81. package/dist/{launch-C3qJ6Agb.mjs → launch-BjxemNpK.mjs} +85 -543
  82. package/dist/{launch-F4sOqAhB.mjs → launch-CCzXlc8r.mjs} +91 -90
  83. package/dist/logs-BfwwadsZ.mjs +479 -0
  84. package/dist/logs-jTS_lHSo.mjs +248 -0
  85. package/dist/{macos-D7uDvO-z.mjs → macos-DVlSSyUg.mjs} +1 -1
  86. package/dist/macos-NfV2D7dO.mjs +694 -0
  87. package/dist/macos-run.mjs +1 -1
  88. package/dist/maintenance-run.mjs +123 -248
  89. package/dist/{metro-DnCEjCxs.mjs → metro-DiXtA3Ty.mjs} +107 -30
  90. package/dist/metro-gateway-CKZqKqx7.mjs +209 -0
  91. package/dist/{named-ports-4WopRPg-.mjs → named-ports-DkEzOfzO.mjs} +42 -90
  92. package/dist/native-android-CqgnOgsT.mjs +645 -0
  93. package/dist/native-gradle-artifact-inputs-DHFnmrVf.mjs +270 -0
  94. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +211 -0
  95. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  96. package/dist/native-run-NwUuxbkg.mjs +276 -0
  97. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-B7KIafpM.mjs} +11 -9
  98. package/dist/native-source-Y0yLhFyQ.mjs +133 -0
  99. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-D_VOfFL7.mjs} +26 -18
  100. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-BYDOHWLN.mjs} +104 -60
  101. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  102. package/dist/offload-worker.d.mts +59 -41
  103. package/dist/offload-worker.mjs +478 -115
  104. package/dist/operation-exec-BW0em61G.mjs +171 -0
  105. package/dist/{ownership-DCtw_2IA.mjs → ownership-C5fo5Edb.mjs} +3 -3
  106. package/dist/{page-DRHy329N.mjs → page-DBL2PiUU.mjs} +12 -5
  107. package/dist/paths-BsJMoPP2.mjs +12 -0
  108. package/dist/paths-DQtTgsBf.mjs +42 -0
  109. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BnGgJRRZ.mjs} +5 -5
  110. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-DIsMtN-d.mjs} +15 -11
  111. package/dist/{ports-DdSUicVo.mjs → ports-Cy1RkmuQ.mjs} +3 -3
  112. package/dist/prebuild-D4JoEAEs.mjs +484 -0
  113. package/dist/{project-_phNIJfs.mjs → project-wM_XFTvE.mjs} +65 -37
  114. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-W1IuLXDt.mjs} +102 -20
  115. package/dist/pull-request-eODyIqZF.d.mts +124 -0
  116. package/dist/pull-requests.d.mts +2 -120
  117. package/dist/pull-requests.mjs +2 -2
  118. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-6OZ7MSM7.mjs} +121 -72
  119. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-Dvd8hC21.mjs} +292 -15
  120. package/dist/react-native-doctor-DsoSF1Y9.mjs +234 -0
  121. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-4u1Rn-GR.mjs} +71 -39
  122. package/dist/{recordings-D0d5aQt0.mjs → recordings-CQmfzAh7.mjs} +12 -9
  123. package/dist/registration-BcRgF6Ox.mjs +51 -0
  124. package/dist/{reload-C8JhxjSh.mjs → reload-BzkYabB-.mjs} +94 -47
  125. package/dist/reload-D7AVlb8N.mjs +2 -0
  126. package/dist/{remote-BiR6aYjy.mjs → remote-DjGDmlTZ.mjs} +26 -18
  127. package/dist/result-D2Ykz_iD.mjs +435 -0
  128. package/dist/{run-BtPgpKks.mjs → run-DidHghD1.mjs} +5 -5
  129. package/dist/selection-DSMbWEX2.mjs +620 -0
  130. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CafzuyFB.mjs} +3 -4
  131. package/dist/{server-command-CTtCkmcQ.mjs → server-command-C6QjeupS.mjs} +14 -7
  132. package/dist/{server-expo-DsguMGUF.mjs → server-expo-CrjB29pq.mjs} +54 -11
  133. package/dist/server-expo-D58c9L0M.mjs +2 -0
  134. package/dist/{settings-B717odTD.mjs → settings-C7O8A6ZI.mjs} +309 -119
  135. package/dist/settings-DpR-1Wnn.mjs +114 -0
  136. package/dist/settings-write-CzD60rOD.mjs +360 -0
  137. package/dist/settings.schema.json +176 -16
  138. package/dist/{simslim-CCr3rE-A.mjs → simslim-BNckWpXi.mjs} +14 -12
  139. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-CbfmNgM6.mjs} +15 -20
  140. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  141. package/dist/stage-Bps5oius.mjs +200 -0
  142. package/dist/{start-TXeMmmO2.mjs → start-Br-oxqMD.mjs} +1 -1
  143. package/dist/start-EojN4WFz.mjs +1364 -0
  144. package/dist/{state-D1Icyjlu.mjs → state--smjFSTL.mjs} +55 -13
  145. package/dist/{state-CG_OFoaA.mjs → state-08I3hw3_.mjs} +3 -2
  146. package/dist/{stats-BoY5sEPU.mjs → stats-D3GerlFW.mjs} +7 -13
  147. package/dist/stats-report-BzaPrRm6.mjs +16 -0
  148. package/dist/{status-BTA7kKiQ.mjs → status-BRROykC8.mjs} +7 -5
  149. package/dist/status-EvrK72L2.mjs +2 -0
  150. package/dist/{status-WgFbkRzj.mjs → status-WBDajew2.mjs} +554 -452
  151. package/dist/{status-watch-C23ILtf9.mjs → status-watch-Bg_u-pwR.mjs} +222 -25
  152. package/dist/status-worker.d.mts +1 -0
  153. package/dist/status-worker.mjs +19 -0
  154. package/dist/stim-desktop-D5OGpYZM.mjs +112 -0
  155. package/dist/{stop-DR6VoDIk.mjs → stop-DTZ9uTw3.mjs} +2 -2
  156. package/dist/{stop-DPEhunlw.mjs → stop-Dky10AEJ.mjs} +33 -23
  157. package/dist/{stop-BNmBMi1F.mjs → stop-Mv6W9FAk.mjs} +137 -98
  158. package/dist/supervisor-run.d.mts +8 -17
  159. package/dist/supervisor-run.mjs +56 -28
  160. package/dist/{support-CwjbFs9H.mjs → support-CNioewsd.mjs} +14 -14
  161. package/dist/{support-DMTqj3Hm.mjs → support-yUiOjnVY.mjs} +20 -13
  162. package/dist/swiftpm-artifact-inputs-DFcGsXDP.mjs +153 -0
  163. package/dist/swiftpm-macos-BIak-Rxv.mjs +532 -0
  164. package/dist/toolchain-BY8X8HXx.mjs +2 -0
  165. package/dist/toolchain-DpJMHq0n.mjs +876 -0
  166. package/dist/{trigger-CigAYjeL.mjs → trigger-Cbyc41d_.mjs} +21 -6
  167. package/dist/trigger-yb_nFzPF.mjs +2 -0
  168. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-CA3TgT3-.mjs} +263 -156
  169. package/dist/web-CZ07gd77.mjs +2 -0
  170. package/dist/{web-BDBMxDpx.mjs → web-DKx6yoFA.mjs} +20 -14
  171. package/dist/web-run.mjs +13 -12
  172. package/dist/windows-report.d.mts +1 -0
  173. package/dist/windows-report.mjs +18 -0
  174. package/dist/windows-report.ps1 +43 -0
  175. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-U08dEzhG.mjs} +62 -58
  176. package/dist/{workspaces-C36s2jb9.mjs → workspaces-CpANmBlq.mjs} +1723 -1286
  177. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-CHecZ4Oq.mjs} +1097 -547
  178. package/dist/worktree-ZqZVjD9K.mjs +2 -0
  179. package/dist/xcode-BXn9-xYx.mjs +896 -0
  180. package/package.json +7 -5
  181. package/shim/android-audio/Main.java +24 -0
  182. package/shim/android-audio/README.md +17 -0
  183. package/shim/android-audio.jar +0 -0
  184. package/shim/android-optimizations.gradle +7 -5
  185. package/dist/activity-BSV745Kz.mjs +0 -629
  186. package/dist/api-qvOzWyfO.mjs +0 -154
  187. package/dist/api-run.mjs +0 -294
  188. package/dist/app-install-BIKtMfPq.mjs +0 -896
  189. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  190. package/dist/budget-f7516Zk0.mjs +0 -4106
  191. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  192. package/dist/cancellation-C_22VQTH.mjs +0 -24
  193. package/dist/client-qQAaXSUs.mjs +0 -1771
  194. package/dist/config-BYDxlMY3.mjs +0 -562
  195. package/dist/device-DuiPJQSn.mjs +0 -290
  196. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  197. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  198. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  199. package/dist/exec-DqKo9GKJ.mjs +0 -268
  200. package/dist/git-DDfFzkMm.mjs +0 -45
  201. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  202. package/dist/logs-BGrEUaEs.mjs +0 -383
  203. package/dist/macos-Ch5VJmcS.mjs +0 -584
  204. package/dist/metro-gateway-CX9Xlkq2.mjs +0 -103
  205. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  206. package/dist/native-android-D5qc3-_v.mjs +0 -226
  207. package/dist/native-gradle-inputs-BsLRrl7u.mjs +0 -349
  208. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  209. package/dist/plan-C4TjdPsR.mjs +0 -260
  210. package/dist/prebuild-DYbucPXy.mjs +0 -212
  211. package/dist/preview-78a9kR_-.mjs +0 -1011
  212. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  213. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  214. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  215. package/dist/result-CaJg5Iat.mjs +0 -186
  216. package/dist/server-expo-Bigriskl.mjs +0 -2
  217. package/dist/settings-BORNaaCO.mjs +0 -402
  218. package/dist/settings-vk3mJGSm.d.mts +0 -13
  219. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  220. package/dist/stage-KNTQopqv.mjs +0 -157
  221. package/dist/start-BWqzODpb.mjs +0 -1116
  222. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  223. package/dist/swiftpm-macos-DRNVJWlb.mjs +0 -119
  224. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  225. package/dist/toolchain-BFkAcstd.mjs +0 -2
  226. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  227. package/dist/trigger-9_USgmxz.mjs +0 -2
  228. package/dist/web-Dq-i3wzJ.mjs +0 -2
  229. package/dist/worktree-DpLdCHga.mjs +0 -2
  230. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  231. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,30 +1,32 @@
1
- import { j as ownership_claim_exports } from "./config-BYDxlMY3.mjs";
2
- import { A as providerDownloadPath, j as providerUploadOutcome, k as prepareProviderDownloadDir, v as waitForSharedBuild } from "./device-lease-BX1sJQ2E.mjs";
3
- import { x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
4
- import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BTy8hZ0F.mjs";
5
- import { x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
6
- import { a as easAuthNote, s as isEasAuthFailureText, t as RESOLVE_TIMEOUT_MS } from "./remote-cache-OyOyVIS3.mjs";
7
- import { _ as requireLocalBuild, c as offloadPlacement, h as namedBuildMachine, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, p as OffloadRefusal, r as chooseBuildMachine, u as remotePhaseText } from "./client-qQAaXSUs.mjs";
8
- import { i as skippedMissReason } from "./miss-reason-mKzZ4VvN.mjs";
9
- import { t as buildPlacementRecord } from "./placement-log-MOfPVgaM.mjs";
10
- import { t as runArtifactLifecycle } from "./artifact-lifecycle-DzPpBYvK.mjs";
11
- import { S as compilationCacheActivityLine, _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-DxSsNssu.mjs";
12
- import { S as xcodeFailureReport, p as printDiagnostics } from "./support-CwjbFs9H.mjs";
13
- import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-K9hY_Jab.mjs";
1
+ import { h as withDrainingCancellation, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
+ import { d as workspaceDir } from "./paths-DQtTgsBf.mjs";
3
+ import { _ as stepTimer, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-gwpm28fu.mjs";
4
+ import { f as throwIfCancelled } from "./operation-exec-BW0em61G.mjs";
5
+ import { Hn as isEasAuthFailureText, Ln as RESOLVE_TIMEOUT_MS, Vn as easAuthNote } from "./budget-Cvwn54qV.mjs";
6
+ import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-NwUuxbkg.mjs";
7
+ import { d as prepareProviderDownloadDir, f as providerDownloadPath, p as providerUploadOutcome } from "./build-cache-Dv7RN200.mjs";
8
+ import { o as compilationCacheActivityLine, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-BXn9-xYx.mjs";
9
+ import { _ as clearCorruptCompilationCache, c as offloadPlacement, g as COMPILATION_CACHE_CORRUPT, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-OyRoEuSr.mjs";
10
+ import { a as requireLocalBuild, r as namedBuildMachine, t as OffloadRefusal } from "./selection-DSMbWEX2.mjs";
11
+ import { S as xcodeFailureReport, p as printDiagnostics } from "./support-CNioewsd.mjs";
12
+ import { l as skippedMissReason } from "./prebuild-D4JoEAEs.mjs";
13
+ import { t as buildPlacementRecord } from "./placement-log-BnGgJRRZ.mjs";
14
+ import { n as settleArtifactUploads, t as acquireArtifact } from "./acquire-artifact-Co2k4f7O.mjs";
15
+ import { r as finishIosUpload, t as IosRecipeRefusal } from "./ios-project-CZhKODF3.mjs";
14
16
  import { rmSync } from "node:fs";
15
17
  import { join } from "node:path";
16
18
  import { machineCapacity } from "@stim-cli/core/state";
17
- import { createWarnOnce, resolveTieredBuild, storeTieredBuild } from "@stim-cli/cache";
18
19
  import chalk from "chalk";
20
+ import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, buildUploadTimeoutMs, createWarnOnce, resolveTieredBuild, storeTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
19
21
  //#region src/commands/ios/artifact.ts
20
22
  const PROVIDER_SKIPPED_ON_DEVICE = "a device build is local-tier only: its cache key names the iphoneos slice, and a remote or provider entry is keyed for the simulator";
21
23
  function fail(failure) {
22
24
  throw new IosRecipeRefusal(failure);
23
25
  }
24
- async function acquireIosArtifact({ root, logFile, recipe, physical, configuration, buildMachine = "auto", cache, easBuild, maxBuilds, progress }, d) {
26
+ async function acquireIosArtifact({ context, root, logFile, recipe, physical, configuration, buildMachine = "auto", cache, easBuild, maxBuilds, progress }, d) {
25
27
  const { phase, note, logWriter, stats, step, miss, hit: lateHit, place, waitingOn, waitingFor } = progress;
26
28
  const cachePolicy = cache.policy;
27
- const signal = runCancellationSignal() ?? new AbortController().signal;
29
+ const signal = runCancellationSignal(context) ?? context.signal;
28
30
  const cacheTarget = (key) => ({
29
31
  projectRoot: root,
30
32
  platform: "ios",
@@ -35,40 +37,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
35
37
  let cacheIneligible = null;
36
38
  const cacheProviderConfig = cache.providerConfig;
37
39
  let compilationCache = COMPILATION_CACHE_NOT_RUN;
38
- const temporaryDirs = /* @__PURE__ */ new Set();
39
- const releaseArtifact = () => {
40
- for (const directory of temporaryDirs) {
41
- try {
42
- rmSync(directory, {
43
- recursive: true,
44
- force: true
45
- });
46
- } catch {}
47
- temporaryDirs.delete(directory);
48
- }
49
- };
50
- let buildLock = null;
51
- const releaseLock = () => {
52
- if (!buildLock) return;
53
- const held = buildLock;
54
- buildLock = null;
55
- try {
56
- d.releaseBuildLock(held);
57
- } catch (e) {
58
- note(chalk.dim(`Could not release the build lock at ${held.path}: ${e?.message || e}`));
59
- }
60
- };
61
- let buildSlot = null;
62
- const releaseSlot = () => {
63
- if (!buildSlot) return;
64
- const held = buildSlot;
65
- buildSlot = null;
66
- try {
67
- d.releaseBuildSlot(held);
68
- } catch (e) {
69
- note(chalk.dim(`Could not release the build slot: ${e?.message || e}`));
70
- }
71
- };
40
+ let run;
72
41
  let fingerprint = "";
73
42
  let cacheKey = "";
74
43
  let storeHash = null;
@@ -80,7 +49,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
80
49
  let handoff = null;
81
50
  let offloadFallback = null;
82
51
  let fallbackMachine = null;
83
- let hereReason = "no remote Mac is paired";
52
+ let hereReason = "no remote machine is paired";
84
53
  let slotWaitMs;
85
54
  let builtOn;
86
55
  const fallBack = (reason, line = reason, info = {}) => {
@@ -104,7 +73,6 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
104
73
  };
105
74
  phase("build", `${line} -> building here`);
106
75
  };
107
- const openOffload = { choice: null };
108
76
  let remote = null;
109
77
  let abandonedRemote = false;
110
78
  let uploadPending = null;
@@ -114,7 +82,9 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
114
82
  const cacheWarn = createWarnOnce((line) => note(chalk.yellow(phaseLine("cache", line))));
115
83
  const loadProvider = cachePolicy.remote && cacheProviderConfig && !physical ? () => providerLoad ??= d.loadCacheProvider({
116
84
  projectRoot: root,
117
- config: cacheProviderConfig
85
+ config: cacheProviderConfig,
86
+ env: context.env,
87
+ timeoutMs: timeoutFromEnv(PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, context.env)
118
88
  }) : null;
119
89
  if (cacheProviderConfig && physical) note(chalk.dim(phaseLine("cache", PROVIDER_SKIPPED_ON_DEVICE)));
120
90
  let waitedForBuild = null;
@@ -130,7 +100,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
130
100
  cacheHit = easBuild.cacheHit;
131
101
  providerName = "eas";
132
102
  stats.setCacheKey(cacheKey);
133
- recipe.validateExternal(appPath);
103
+ await recipe.validateExternal(appPath);
134
104
  return;
135
105
  }
136
106
  if (useBuildCache) step("cache-lookup");
@@ -147,7 +117,8 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
147
117
  stats.setCacheKey(cacheKey);
148
118
  storeHash = fingerprint;
149
119
  storeKey = cacheKey;
150
- const found = await resolveTieredBuild({
120
+ const found = await withDrainingCancellation(context, signal, () => resolveTieredBuild({
121
+ timeoutMs: buildResolveTimeoutMs(context.env),
151
122
  local: recipe.cache(),
152
123
  loadProvider,
153
124
  target: {
@@ -156,10 +127,11 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
156
127
  key: cacheKey
157
128
  },
158
129
  destinationDir: providerDownloadPath(workspaceDir(root)),
159
- ensureDestination: prepareProviderDownloadDir,
130
+ ensureDestination: (dir) => prepareProviderDownloadDir(dir, root),
160
131
  skipRead: !useBuildCache,
161
- warn: cacheWarn
162
- });
132
+ warn: cacheWarn,
133
+ signal
134
+ }));
163
135
  const cached = found?.tier === "local" ? found.path : null;
164
136
  cacheHit = cached ? "local" : false;
165
137
  phase("fingerprint", `${shortHash(fingerprint)} ${cached ? "hit" : "miss"}${useBuildCache ? "" : cache.disabledByFlag ? " (--no-build-cache)" : " (cache reuse off in config)"} ${fingerprintTimer()}`);
@@ -171,13 +143,14 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
171
143
  appPath = found?.path ?? null;
172
144
  }
173
145
  async function resolveRemoteArtifact() {
174
- if (cacheIneligible || !recipe.legacyCache) return null;
146
+ if (cacheIneligible || !recipe.expoCache) return null;
175
147
  if (!appPath) {
176
- const loaded = await recipe.legacyCache.load();
148
+ const loaded = await recipe.expoCache.load();
177
149
  if (loaded?.unavailable) note(chalk.yellow(phaseLine("cache", `provider not usable: ${loaded.unavailable}`)));
178
150
  else if (loaded?.provider) remote = loaded;
179
151
  if (remote?.name === "eas") {
180
- const auth = d.checkEasAuth({
152
+ const auth = await d.checkEasAuth({
153
+ context,
181
154
  projectRoot: root,
182
155
  owner: loaded?.owner || null
183
156
  });
@@ -189,12 +162,13 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
189
162
  if (remote && useBuildCache) {
190
163
  const remoteTimer = stepTimer(d.now);
191
164
  const hit = await d.resolveRemote({
165
+ context,
192
166
  logWriter: logWriter(),
193
167
  provider: remote.provider,
194
168
  platform: "ios",
195
169
  projectRoot: root,
196
170
  fingerprintHash: fingerprint,
197
- runOptions: recipe.legacyCache?.runOptions ?? null
171
+ runOptions: recipe.expoCache?.runOptions ?? null
198
172
  });
199
173
  if (hit?.appPath) {
200
174
  let stored = null;
@@ -205,6 +179,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
205
179
  overwrite: false
206
180
  }) ?? null;
207
181
  } catch (e) {
182
+ throwIfCancelled(signal, "build cache backfill");
208
183
  note(chalk.yellow(phaseLine("cache", `remote hit could not be stored locally: ${e?.message || e}`)));
209
184
  }
210
185
  appPath = stored || hit.appPath;
@@ -225,16 +200,9 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
225
200
  }
226
201
  async function awaitSharedBuild() {
227
202
  if (!useBuildCache || appPath) return;
228
- const shared = await waitForSharedBuild({
229
- platform: "ios",
203
+ const shared = await run.claimSharedBuild({
230
204
  key: cacheKey,
231
205
  fingerprint,
232
- root,
233
- logFile,
234
- command: "stim ios",
235
- acquire: d.acquireBuildLock,
236
- wait: d.waitForBuild,
237
- now: d.now,
238
206
  phase: (text) => {
239
207
  step("wait");
240
208
  phase("build", text);
@@ -252,7 +220,6 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
252
220
  cacheSkipped: !useBuildCache
253
221
  }
254
222
  });
255
- buildLock = shared.lock;
256
223
  releasedWait = shared.released;
257
224
  if (shared.hit) {
258
225
  appPath = shared.hit.path;
@@ -263,7 +230,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
263
230
  const installableCachedApp = async (path) => {
264
231
  const prepared = await recipe.materialize(path, {
265
232
  fresh: false,
266
- ownTemporary: (directory) => temporaryDirs.add(directory)
233
+ ownTemporary: (directory) => run.own(directory)
267
234
  });
268
235
  if (!prepared) swapFellBack = true;
269
236
  return prepared;
@@ -321,16 +288,15 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
321
288
  requireLocalBuild(buildMachine);
322
289
  if (!maxBuilds) return;
323
290
  try {
324
- buildSlot = await d.acquireBuildSlot({
291
+ slotWaitMs = (await run.takeBuildSlot({
292
+ signal,
325
293
  automatic: buildMachine === "auto",
326
294
  max: maxBuilds,
327
- root,
328
- logFile,
329
295
  out: note,
330
296
  waitingFor: (info) => waitingFor?.(info, "build-slot")
331
- });
332
- slotWaitMs = buildSlot.slotWaitMs;
297
+ })).slotWaitMs;
333
298
  } catch (e) {
299
+ throwIfCancelled(signal, "iOS build");
334
300
  requireLocalBuild(buildMachine);
335
301
  const refusal = (0, ownership_claim_exports.claimFailure)(e, "stim ios");
336
302
  if (refusal) fail({
@@ -342,8 +308,8 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
342
308
  note(chalk.yellow(phaseLine("build", `could not take a build slot: ${e?.message || e}; building anyway`)));
343
309
  }
344
310
  }
345
- /** Whether this build should leave this Mac, before any machine is asked; null builds here. */
346
- function placeBuild() {
311
+ /** Whether this build should leave this machine, before any machine is asked; null builds here. */
312
+ async function placeBuild() {
347
313
  if (cacheIneligible) {
348
314
  if (namedBuildMachine(buildMachine)) throw new OffloadRefusal(buildMachine, cacheIneligible);
349
315
  hereReason = cacheIneligible;
@@ -354,7 +320,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
354
320
  const { runtime, unsupported } = mode === "off" && !namedBuildMachine(buildMachine) ? {
355
321
  runtime: null,
356
322
  unsupported: null
357
- } : recipe.offload?.context() ?? {
323
+ } : await recipe.offload?.context() ?? {
358
324
  runtime: null,
359
325
  unsupported: "this project integration does not support offloaded builds"
360
326
  };
@@ -369,6 +335,15 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
369
335
  });
370
336
  if (!placement.offload) {
371
337
  hereReason = placement.reason;
338
+ if (placement.code === "this-mac-free" && runtime && useBuildCache && cachePolicy.remote && recipe.offload !== void 0) return {
339
+ cacheOnly: true,
340
+ mode,
341
+ here,
342
+ code: placement.code,
343
+ reason: placement.reason,
344
+ runtime,
345
+ machines
346
+ };
372
347
  logWriter().write(buildPlacementRecord({
373
348
  platform: "ios",
374
349
  buildMachine,
@@ -381,6 +356,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
381
356
  return null;
382
357
  }
383
358
  return {
359
+ cacheOnly: false,
384
360
  mode,
385
361
  here,
386
362
  code: placement.code,
@@ -391,18 +367,30 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
391
367
  }
392
368
  /** Asks the paired machines once the post-mutation key is known; null builds here. */
393
369
  async function chooseMachine(candidate) {
370
+ const offload = recipe.offload;
371
+ if (!offload) return null;
394
372
  let asked = [];
395
373
  const choice = await chooseBuildMachine({
396
374
  projectRoot: root,
397
- target: recipe.offload.target(candidate.runtime),
375
+ target: await offload.target(candidate.runtime),
398
376
  mode: candidate.mode,
399
377
  here: candidate.here,
400
378
  note: (line) => note(chalk.dim(phaseLine("build", `offload: ${line}`))),
401
379
  machines: candidate.machines,
402
380
  selected: buildMachine,
403
- onCandidates: (each) => asked = each
381
+ onCandidates: (each) => asked = each,
382
+ cacheOnly: candidate.cacheOnly,
383
+ ...useBuildCache && cachePolicy.remote && storeHash && !offload.request(candidate.runtime).native ? { reactNativeArtifact: {
384
+ fingerprint: storeHash,
385
+ request: offload.request(candidate.runtime)
386
+ } } : {},
387
+ ...useBuildCache && cachePolicy.remote && storeHash && storeKey && offload.request(candidate.runtime).native?.provider === "xcode" ? { artifact: {
388
+ fingerprint: storeHash,
389
+ cacheKey: storeKey
390
+ } } : {}
404
391
  });
405
392
  if (typeof choice === "string") {
393
+ if (candidate.cacheOnly) return null;
406
394
  const only = candidate.machines.length === 1 ? candidate.machines[0].machine : null;
407
395
  if (only && choice.startsWith(`${only}: `)) fallbackMachine = only;
408
396
  fallBack(choice, choice, {
@@ -411,7 +399,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
411
399
  });
412
400
  return null;
413
401
  }
414
- openOffload.choice = choice;
402
+ run.openOffload(() => closeOffload(choice));
415
403
  logWriter().write(buildPlacementRecord({
416
404
  platform: "ios",
417
405
  buildMachine,
@@ -479,13 +467,22 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
479
467
  force: true
480
468
  });
481
469
  } catch {}
470
+ throwIfCancelled(signal, "offloaded build cache copy");
482
471
  step("compile");
483
472
  const prepared = stored ? await installableCachedApp(stored) : null;
484
473
  if (!outcome.ok || !prepared) {
485
474
  const why = reason ?? "the stored app is not installable";
475
+ if (candidate.cacheOnly) return false;
486
476
  fallbackMachine = choice.machine;
477
+ const corrupt = outcome.ok ? void 0 : outcome.compilationCacheCorrupt;
478
+ if (corrupt !== void 0 && namedBuildMachine(buildMachine)) fail({
479
+ code: COMPILATION_CACHE_CORRUPT,
480
+ message: `${choice.machine}: ${corrupt}`,
481
+ remedy: `Run the same command again. If the message says Stim did not empty the cache on ${choice.machine}, rerun with --remote-build local to build here.`,
482
+ build: buildFailure
483
+ });
487
484
  fallBack(`${choice.machine}: ${why}`, `offload failed: ${why}`, {
488
- code: "offload-failed",
485
+ code: corrupt === void 0 ? "offload-failed" : COMPILATION_CACHE_CORRUPT,
489
486
  machine: choice.machine
490
487
  });
491
488
  logWriter().write({
@@ -499,6 +496,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
499
496
  }
500
497
  const { timings } = outcome;
501
498
  appPath = prepared;
499
+ if (outcome.cacheHit) cacheHit = "remote";
502
500
  builtOn = outcome.machine;
503
501
  offloadedTo = outcome.machine;
504
502
  handoff = outcome.handoff ?? null;
@@ -508,14 +506,14 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
508
506
  reason: `${candidate.reason}${placementLoad(choice)}`,
509
507
  buildMs: timings.totalMs
510
508
  });
511
- phase("build", `built on ${outcome.machine} in ${formatDuration(timings.totalMs)}: offer ${formatDuration(timings.offerMs)}, sync ${formatDuration(timings.syncMs)}, build ${formatDuration(timings.workerMs)}, fetch ${formatDuration(timings.fetchMs)}`);
509
+ phase("build", `${outcome.cacheHit ? "reused artifact from" : "built on"} ${outcome.machine} in ${formatDuration(timings.totalMs)}: offer ${formatDuration(timings.offerMs)}, sync ${formatDuration(timings.syncMs)}, build ${formatDuration(timings.workerMs)}, fetch ${formatDuration(timings.fetchMs)}`);
512
510
  compilationCache = outcome.compilationCache;
513
511
  phase("cache", `compilation cache on ${outcome.machine} ${compilationCacheActivityLine(compilationCache)}`);
514
512
  logWriter().write({
515
513
  src: "build",
516
514
  level: "info",
517
515
  event: "offload_done",
518
- msg: `built on ${outcome.machine}`,
516
+ msg: `${outcome.cacheHit ? "reused artifact from" : "built on"} ${outcome.machine}`,
519
517
  timings
520
518
  });
521
519
  return true;
@@ -575,7 +573,7 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
575
573
  async function compileHere(offload, { rekeyedBy }) {
576
574
  if (!offload) explainMiss(rekeyedBy);
577
575
  step("compile");
578
- if (offload) stats.setPlacement({
576
+ if (offload && !offload.cacheOnly) stats.setPlacement({
579
577
  decision: "fell-back",
580
578
  slotWaitMs,
581
579
  deviceSlotWaitMs: stats.deviceSlotWaitMs(),
@@ -601,9 +599,12 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
601
599
  if (!result.ok) {
602
600
  phase("build", `FAILED after ${formatDuration(result.durationMs)}`);
603
601
  printDiagnostics(note, result);
604
- const report = xcodeFailureReport(result, logFile);
605
- fail({
602
+ const report = result.compilationCacheCorruption ? await clearCorruptCompilationCache(result.compilationCacheCorruption, root) : {
606
603
  code: result.code,
604
+ ...xcodeFailureReport(result, logFile)
605
+ };
606
+ fail({
607
+ code: report.code,
607
608
  message: report.message,
608
609
  remedy: report.remedy,
609
610
  logPath: logFile,
@@ -620,30 +621,38 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
620
621
  return appPath;
621
622
  }
622
623
  async function storeArtifact(artifactPath) {
623
- if (storeKey && cachePolicy.write) try {
624
- const stored = await storeTieredBuild({
625
- local: recipe.cache(),
626
- loadProvider,
627
- target: {
628
- projectRoot: root,
629
- platform: "ios",
630
- key: storeKey
631
- },
632
- sourcePath: artifactPath,
633
- overwrite: !useBuildCache || swapFellBack,
634
- warn: cacheWarn
635
- });
636
- providerUpload = stored.providerUpload;
637
- providerName = stored.providerName ?? providerName;
638
- } catch (e) {
639
- note(chalk.yellow(`Could not store the build in the shared cache: ${e?.message || e}`));
624
+ if (storeKey && cachePolicy.write) {
625
+ const key = storeKey;
626
+ try {
627
+ const stored = await withDrainingCancellation(context, signal, () => storeTieredBuild({
628
+ timeoutMs: buildUploadTimeoutMs(context.env),
629
+ local: recipe.cache(),
630
+ loadProvider,
631
+ target: {
632
+ projectRoot: root,
633
+ platform: "ios",
634
+ key
635
+ },
636
+ sourcePath: artifactPath,
637
+ overwrite: !useBuildCache || swapFellBack,
638
+ warn: cacheWarn,
639
+ signal
640
+ }));
641
+ const pending = stored.providerUpload;
642
+ providerUpload = pending ? withDrainingCancellation(context, signal, () => pending) : null;
643
+ providerUpload?.catch(() => {});
644
+ providerName = stored.providerName ?? providerName;
645
+ } catch (e) {
646
+ throwIfCancelled(signal, "build cache storage");
647
+ note(chalk.yellow(`Could not store the build in the shared cache: ${e?.message || e}`));
648
+ }
640
649
  }
641
650
  }
642
651
  async function finishArtifact(artifactPath) {
643
652
  let installPath = artifactPath;
644
653
  const prepared = await recipe.materialize(installPath, {
645
654
  fresh: true,
646
- ownTemporary: (directory) => temporaryDirs.add(directory)
655
+ ownTemporary: (directory) => run.own(directory)
647
656
  });
648
657
  if (!prepared) fail({
649
658
  code: "STIM_INSTALL_FAILED",
@@ -655,76 +664,128 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
655
664
  }
656
665
  });
657
666
  installPath = prepared;
658
- if (remote && !physical && storeHash) uploadPending = d.uploadRemote({
659
- logWriter: logWriter(),
660
- provider: remote.provider,
661
- platform: "ios",
662
- projectRoot: root,
663
- fingerprintHash: storeHash,
664
- buildPath: installPath,
665
- runOptions: recipe.legacyCache?.runOptions ?? null
666
- });
667
+ if (remote && !physical && storeHash) {
668
+ uploadPending = d.uploadRemote({
669
+ context,
670
+ logWriter: logWriter(),
671
+ provider: remote.provider,
672
+ platform: "ios",
673
+ projectRoot: root,
674
+ fingerprintHash: storeHash,
675
+ buildPath: installPath,
676
+ runOptions: recipe.expoCache?.runOptions ?? null
677
+ });
678
+ uploadPending.catch(() => {});
679
+ }
667
680
  return installPath;
668
681
  }
669
- let transferred = false;
670
- try {
671
- appPath = await runArtifactLifecycle({
672
- resolve: async () => {
673
- await resolveInitialFingerprint();
674
- if (easBuild) return {
675
- kind: "ready",
676
- artifact: appPath
677
- };
678
- remote = await resolveRemoteArtifact();
679
- if (appPath) return {
680
- kind: "cached",
681
- artifact: appPath
682
- };
683
- miss(reasonForMiss([]).reason);
684
- return { kind: "miss" };
685
- },
686
- claim: useBuildCache ? async () => {
687
- await awaitSharedBuild();
688
- return appPath;
689
- } : void 0,
690
- reuse: async (cached) => {
691
- appPath = await prepareCachedArtifact(cached);
692
- if (appPath) lateHit();
693
- else if (swapFellBack) miss(reasonForMiss([]).reason);
694
- return appPath;
695
- },
696
- build: {
697
- placement: {
698
- select: () => {
699
- buildFailure = {
700
- fingerprint,
701
- cacheKey,
702
- cacheHit,
703
- cacheSkipped: !useBuildCache,
704
- buildMachine
705
- };
706
- return placeBuild();
707
- },
708
- acquire: acquireRemoteArtifact
682
+ const acquired = await acquireArtifact({
683
+ platform: "ios",
684
+ command: "stim ios",
685
+ lifecycle: (driver) => {
686
+ run = driver;
687
+ return {
688
+ resolve: async () => {
689
+ await resolveInitialFingerprint();
690
+ if (easBuild) return {
691
+ kind: "ready",
692
+ artifact: appPath
693
+ };
694
+ remote = await resolveRemoteArtifact();
695
+ if (appPath) return {
696
+ kind: "cached",
697
+ artifact: appPath
698
+ };
699
+ miss(reasonForMiss([]).reason);
700
+ return { kind: "miss" };
709
701
  },
710
- admit: takeBuildSlot,
711
- prepare: prepareSource,
712
- revalidate: revalidateSource,
713
- compile: compileHere,
714
- validate: async () => {
715
- await settleStoreKeyAfterCompile();
716
- return storeKey ? "cacheable" : "uncacheable";
702
+ claim: useBuildCache ? async () => {
703
+ await awaitSharedBuild();
704
+ return appPath;
705
+ } : void 0,
706
+ reuse: async (cached) => {
707
+ appPath = await prepareCachedArtifact(cached);
708
+ if (appPath) lateHit();
709
+ else if (swapFellBack) miss(reasonForMiss([]).reason);
710
+ return appPath;
717
711
  },
718
- store: storeArtifact,
719
- finish: finishArtifact
720
- },
721
- release: () => {
722
- if (openOffload.choice) closeOffload(openOffload.choice);
723
- releaseLock();
724
- releaseSlot();
725
- }
726
- });
727
- const artifact = {
712
+ build: {
713
+ placement: {
714
+ select: () => {
715
+ buildFailure = {
716
+ fingerprint,
717
+ cacheKey,
718
+ cacheHit,
719
+ cacheSkipped: !useBuildCache,
720
+ buildMachine
721
+ };
722
+ return placeBuild();
723
+ },
724
+ acquire: acquireRemoteArtifact
725
+ },
726
+ admit: takeBuildSlot,
727
+ prepare: prepareSource,
728
+ revalidate: revalidateSource,
729
+ compile: compileHere,
730
+ validate: async () => {
731
+ await settleStoreKeyAfterCompile();
732
+ return storeKey ? "cacheable" : "uncacheable";
733
+ },
734
+ store: storeArtifact,
735
+ finish: finishArtifact
736
+ }
737
+ };
738
+ },
739
+ settleFailed: async () => {
740
+ await settleArtifactUploads(uploadPending, providerUpload);
741
+ },
742
+ refuse: (error) => {
743
+ if (error instanceof OffloadRefusal) return {
744
+ code: error.code,
745
+ message: error.message,
746
+ remedy: error.remedy,
747
+ build: {
748
+ ...buildFailure,
749
+ buildMachine,
750
+ ...builtOn ? { builtOn } : {}
751
+ }
752
+ };
753
+ if (error instanceof IosRecipeRefusal) return {
754
+ ...error.failure,
755
+ build: {
756
+ ...buildFailure,
757
+ ...error.failure.build
758
+ }
759
+ };
760
+ const cancelled = cancelledFailure(context, "ios", {
761
+ code: "STIM_CANCELLED",
762
+ message: "during app preparation"
763
+ });
764
+ return cancelled ? {
765
+ ...cancelled,
766
+ build: {
767
+ ...buildFailure,
768
+ buildMachine,
769
+ ...builtOn ? { builtOn } : {}
770
+ }
771
+ } : null;
772
+ },
773
+ releaseFailed: (subject, e) => note(chalk.dim(`Could not release ${subject}: ${e?.message || e}`)),
774
+ temporaryReleaseFailed: () => {}
775
+ }, {
776
+ root,
777
+ logFile,
778
+ deps: d
779
+ });
780
+ if (!acquired.ok) return {
781
+ ok: false,
782
+ failure: acquired.failure,
783
+ compilationCache
784
+ };
785
+ appPath = acquired.artifact;
786
+ return {
787
+ ok: true,
788
+ artifact: {
728
789
  handoff,
729
790
  path: appPath,
730
791
  bundleId,
@@ -755,53 +816,19 @@ async function acquireIosArtifact({ root, logFile, recipe, physical, configurati
755
816
  },
756
817
  completeUploads: async () => {
757
818
  const uploadWasAbandoned = await finishIosUpload(uploadPending, remote, phase, note);
758
- const outcome = providerUploadOutcome(providerUpload ? await providerUpload : null, providerName);
819
+ const outcome = providerUploadOutcome(providerUpload ? await providerUpload : null, providerName, context.env);
759
820
  if (outcome) {
760
821
  if (outcome.warn) note(chalk.yellow(phaseLine("cache", outcome.line)));
761
822
  else phase("cache", outcome.line);
762
823
  }
763
824
  return abandonedRemote || uploadWasAbandoned;
764
825
  },
765
- release: releaseArtifact
766
- };
767
- transferred = true;
768
- return {
769
- ok: true,
770
- artifact
771
- };
772
- } catch (error) {
773
- if (error instanceof OffloadRefusal) {
774
- const refusal = error;
775
- return {
776
- ok: false,
777
- failure: {
778
- code: refusal.code,
779
- message: refusal.message,
780
- remedy: refusal.remedy,
781
- build: {
782
- ...buildFailure,
783
- buildMachine,
784
- ...builtOn ? { builtOn } : {}
785
- }
786
- },
787
- compilationCache
788
- };
826
+ release: async () => {
827
+ await settleArtifactUploads(providerUpload, uploadPending);
828
+ acquired.release();
829
+ }
789
830
  }
790
- if (error instanceof IosRecipeRefusal) return {
791
- ok: false,
792
- failure: {
793
- ...error.failure,
794
- build: {
795
- ...buildFailure,
796
- ...error.failure.build
797
- }
798
- },
799
- compilationCache
800
- };
801
- throw error;
802
- } finally {
803
- if (!transferred) releaseArtifact();
804
- }
831
+ };
805
832
  }
806
833
  //#endregion
807
834
  export { acquireIosArtifact as t };