stim 1.20.2 → 1.21.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 (217) hide show
  1. package/README.md +88 -8
  2. package/dist/acquire-artifact-CD4lbiWE.mjs +153 -0
  3. package/dist/act-DHAw2A2S.mjs +2667 -0
  4. package/dist/activity-BzVfHSrY.mjs +1376 -0
  5. package/dist/{agent-device-usage-output-Dzgv6lgR.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -65
  6. package/dist/{android-HqP1_vB_.mjs → android-BEJ8Jpl7.mjs} +2 -2
  7. package/dist/{android-DCKZrNvV.mjs → android-BLgbNqox.mjs} +128 -78
  8. package/dist/{android-Dlzxshgp.mjs → android-CV_GCELZ.mjs} +5 -5
  9. package/dist/{android-Mz_Inn3w.mjs → android-DUYkNF4u.mjs} +184 -102
  10. package/dist/{android-cas-Bl-cLJBk.mjs → android-cas-Ct5b1xCK.mjs} +7 -6
  11. package/dist/android-cas-compiler.mjs +2 -2
  12. package/dist/android-project-BCAAmMwz.mjs +12 -0
  13. package/dist/api.d.mts +740 -8
  14. package/dist/api.mjs +585 -1
  15. package/dist/{artifact-HSwkIWEQ.mjs → artifact-B8T3S5gi.mjs} +223 -201
  16. package/dist/{artifact-D3czlUvT.mjs → artifact-DAuZ-FNU.mjs} +158 -148
  17. package/dist/{browser-web-CA-F1GQo.mjs → browser-web-QQzVjz3O.mjs} +26 -24
  18. package/dist/budget-Bs6SxxzO.mjs +9154 -0
  19. package/dist/{build-DYDbfkk5.mjs → build-CoPzQRNw.mjs} +144 -96
  20. package/dist/build-cache-DmyR9Zzc.mjs +602 -0
  21. package/dist/build-plan-CaFskB7_.mjs +188 -0
  22. package/dist/{cache-manifest-XH-fvDUj.mjs → cache-manifest-DkkqguoK.mjs} +2 -2
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-zdKiYQ3E.mjs → ccache-BJRZ9pG3.mjs} +10 -9
  25. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
  26. package/dist/{chrome-BnzZMqsR.mjs → chrome-B6tfCta1.mjs} +7 -4
  27. package/dist/{cli-CLP3diBm.mjs → cli-0DYf8QhQ.mjs} +20 -20
  28. package/dist/cli.mjs +1 -1
  29. package/dist/client-B7QVOlCr.d.mts +253 -0
  30. package/dist/client-UXD70ZbM.mjs +1406 -0
  31. package/dist/collector-run.d.mts +4 -40
  32. package/dist/collector-run.mjs +9 -8
  33. package/dist/{command-output-BTy8hZ0F.mjs → command-output-B1UrjZHL.mjs} +1 -1
  34. package/dist/config-CYcBF478.mjs +949 -0
  35. package/dist/{created-devices-Dzd5C2LF.mjs → created-devices-CqeBlrEn.mjs} +3 -3
  36. package/dist/{dependency-state-DG0p31-y.mjs → dependency-state-BbKQW83h.mjs} +20 -5
  37. package/dist/{detached-entry-B9C_zeQC.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
  38. package/dist/{dev-client-DAWVIGBu.mjs → dev-client-UOeESKm6.mjs} +2 -2
  39. package/dist/device-DCxH7_By.mjs +1068 -0
  40. package/dist/{device-BECOiufl.mjs → device-ExJq8Ei7.mjs} +35 -35
  41. package/dist/{device-capacity-CBUAcRyQ.mjs → device-capacity-CMlqEcvw.mjs} +43 -13
  42. package/dist/device-host-worker.mjs +65 -61
  43. package/dist/{device-ios-COSi6oS1.mjs → device-ios-DRUeKaFV.mjs} +48 -45
  44. package/dist/{device-lease-run-Cw2M4z51.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
  45. package/dist/{device-pool-Bf-pOhSw.mjs → device-pool-DMRpVX9a.mjs} +5 -5
  46. package/dist/doctor-BLHCYxzi.mjs +2 -0
  47. package/dist/{doctor-kfMBnUw6.mjs → doctor-DTvaDOda.mjs} +281 -317
  48. package/dist/{doctor-CB8oZKCk.mjs → doctor-Dhqebm0q.mjs} +183 -91
  49. package/dist/doctor-fingerprint.mjs +19 -0
  50. package/dist/{doctor-watchman-BRyV2adA.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -21
  51. package/dist/{eas-build-JyfqyHfC.mjs → eas-build-BomfRnFT.mjs} +53 -20
  52. package/dist/{build-plan-B7SZsc2N.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
  53. package/dist/{watchman-CPQFZLXY.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
  54. package/dist/{error-diagnostics-BR677IDM.mjs → error-diagnostics-Bf0rZvG9.mjs} +172 -82
  55. package/dist/exec-H20xSg2T.d.mts +65 -0
  56. package/dist/exec-_UbtCQcG.mjs +750 -0
  57. package/dist/gc-C-WwL0yi.mjs +3 -0
  58. package/dist/{gc-qWOMdnER.mjs → gc-_-dCXdyL.mjs} +584 -796
  59. package/dist/git-C3iTsJaZ.mjs +73 -0
  60. package/dist/{guide-G9cAbVAc.mjs → guide-Yqwt2bd6.mjs} +941 -269
  61. package/dist/{hosted-android-C3MHGld1.mjs → hosted-android-Bw-honsd.mjs} +8 -6
  62. package/dist/{hosted-client-ZEKpS9vw.mjs → hosted-client-DB_gBPfY.mjs} +34 -19
  63. package/dist/{hosted-ios-l-o3iM9J.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
  64. package/dist/{hosted-logs-EzQM7-3Z.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
  65. package/dist/{hosted-macos-BACVAVqE.mjs → hosted-macos-QI141yKk.mjs} +21 -17
  66. package/dist/{hosted-native-A4s1QPXe.mjs → hosted-native-Ksyjgzq-.mjs} +30 -21
  67. package/dist/idle-BVeRGroT.d.mts +24 -0
  68. package/dist/{idle-shutdown-DtxhPTKe.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
  69. package/dist/{ios-BwVCF7oA.mjs → ios-CQ68hG9s.mjs} +8 -8
  70. package/dist/{ios-RkW4pnQf.mjs → ios-CpByZy12.mjs} +140 -80
  71. package/dist/{ios-device-B5veSDDQ.mjs → ios-device-CXGP1bsD.mjs} +1 -1
  72. package/dist/{ios-device-D7pi2Sca.mjs → ios-device-CwFMehUS.mjs} +51 -26
  73. package/dist/{ios-project-K9hY_Jab.mjs → ios-project-WuwwBdvW.mjs} +13 -13
  74. package/dist/{ios-nOLJGVdy.mjs → ios-qNJt4dFm.mjs} +1 -1
  75. package/dist/ios-signing-DTTIChGs.mjs +489 -0
  76. package/dist/{ios-state-CBLe1xYw.mjs → ios-state-DvFX-K_l.mjs} +1 -1
  77. package/dist/{ios-Ce7bc7br.mjs → ios-ubFsBzwq.mjs} +129 -86
  78. package/dist/{js-swap-Bb3nsS07.mjs → js-swap-Cc1dttps.mjs} +53 -26
  79. package/dist/{launch-F4sOqAhB.mjs → launch-CD1yVc7U.mjs} +91 -90
  80. package/dist/{launch-C3qJ6Agb.mjs → launch-Zq2mOSDy.mjs} +82 -541
  81. package/dist/logs-BS00Anxf.mjs +352 -0
  82. package/dist/logs-CMm05HxN.mjs +255 -0
  83. package/dist/{macos-D7uDvO-z.mjs → macos-B65--pPd.mjs} +1 -1
  84. package/dist/{macos-Ch5VJmcS.mjs → macos-C-0qJ6zq.mjs} +225 -212
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +122 -247
  87. package/dist/{metro-DnCEjCxs.mjs → metro-DEXpIhHC.mjs} +67 -12
  88. package/dist/{metro-gateway-CX9Xlkq2.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
  89. package/dist/{named-ports-4WopRPg-.mjs → named-ports-BWTzt6mu.mjs} +8 -63
  90. package/dist/native-android-JACyjTZs.mjs +844 -0
  91. package/dist/{native-gradle-inputs-BsLRrl7u.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -140
  92. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  93. package/dist/native-run-DY_RLx3C.mjs +277 -0
  94. package/dist/{native-runtime-k8dTIrbK.mjs → native-runtime-Dg1Q7tfF.mjs} +9 -8
  95. package/dist/{native-xcode-inputs-CykopJdM.mjs → native-xcode-inputs-CB2iQeWq.mjs} +27 -18
  96. package/dist/{native-xcode-ios-Bbf30Gm0.mjs → native-xcode-ios-CXX39F7o.mjs} +96 -47
  97. package/dist/{ndjson-GOnbyvso.mjs → ndjson-CgE_o3Dl.mjs} +3 -3
  98. package/dist/offload-worker.d.mts +1 -46
  99. package/dist/offload-worker.mjs +197 -66
  100. package/dist/{ownership-DCtw_2IA.mjs → ownership-DEmM5vhh.mjs} +3 -3
  101. package/dist/{page-DRHy329N.mjs → page-CPaHeYqj.mjs} +7 -4
  102. package/dist/paths-BsJMoPP2.mjs +12 -0
  103. package/dist/paths-DQtTgsBf.mjs +42 -0
  104. package/dist/{placement-log-MOfPVgaM.mjs → placement-log-BqGbTa61.mjs} +5 -5
  105. package/dist/{plan-placement-V0TdzYXp.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
  106. package/dist/{ports-DdSUicVo.mjs → ports-D-MmCTdv.mjs} +3 -3
  107. package/dist/prebuild-uD_ipCxF.mjs +449 -0
  108. package/dist/{project-_phNIJfs.mjs → project-BZNjmW_8.mjs} +65 -37
  109. package/dist/{pull-request-CQ8sPbZa.mjs → pull-request-Lfetn8Kr.mjs} +2 -2
  110. package/dist/pull-request-zjCSAryH.d.mts +120 -0
  111. package/dist/pull-requests.d.mts +1 -119
  112. package/dist/pull-requests.mjs +1 -1
  113. package/dist/{react-native-android-CM1XRDwv.mjs → react-native-android-DuzH0cn3.mjs} +74 -48
  114. package/dist/{gradle-DSrXb6lG.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
  115. package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
  116. package/dist/{react-native-ios-Dhq_eiYQ.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
  117. package/dist/{recordings-D0d5aQt0.mjs → recordings-DYteQSu4.mjs} +12 -9
  118. package/dist/{reload-C8JhxjSh.mjs → reload-CmTRFJaX.mjs} +93 -47
  119. package/dist/reload-DzjSl5P_.mjs +2 -0
  120. package/dist/{remote-BiR6aYjy.mjs → remote-ByYkXdGD.mjs} +15 -10
  121. package/dist/result-DNiS-tTP.mjs +434 -0
  122. package/dist/{run-BtPgpKks.mjs → run-D23HmJMs.mjs} +4 -5
  123. package/dist/selection-CSl9i5qU.mjs +619 -0
  124. package/dist/{server-bare-R2m_gsH8.mjs → server-bare-CxTrvDg8.mjs} +3 -4
  125. package/dist/{server-command-CTtCkmcQ.mjs → server-command-CtzloH3v.mjs} +14 -7
  126. package/dist/server-expo-C-90EhcG.mjs +2 -0
  127. package/dist/{server-expo-DsguMGUF.mjs → server-expo-DT_F_uVI.mjs} +50 -9
  128. package/dist/{settings-B717odTD.mjs → settings-CsJDEXgK.mjs} +234 -24
  129. package/dist/{settings-vk3mJGSm.d.mts → settings-DkdmlelE.d.mts} +6 -4
  130. package/dist/settings-T1gtc3bf.mjs +114 -0
  131. package/dist/settings-write-HyVZ8eQ8.mjs +359 -0
  132. package/dist/settings.schema.json +163 -16
  133. package/dist/{simslim-CCr3rE-A.mjs → simslim-Cgk17SXV.mjs} +14 -12
  134. package/dist/{slot-launch-DPt0m9Nd.mjs → slot-launch-DF8VfT64.mjs} +15 -20
  135. package/dist/{spawn-entry-Dcb7sDUz.mjs → spawn-entry-jw19m8Nl.mjs} +0 -1
  136. package/dist/stage-BIS0ydsV.mjs +183 -0
  137. package/dist/{start-BWqzODpb.mjs → start-7lpH7hmN.mjs} +63 -44
  138. package/dist/{start-TXeMmmO2.mjs → start-RChynRDp.mjs} +1 -1
  139. package/dist/{state-D1Icyjlu.mjs → state-C4ZtUisW.mjs} +40 -13
  140. package/dist/{state-CG_OFoaA.mjs → state-XMziexv2.mjs} +3 -2
  141. package/dist/{stats-BoY5sEPU.mjs → stats-53T7OTb9.mjs} +7 -13
  142. package/dist/stats-report-BFfMpWWF.mjs +16 -0
  143. package/dist/{status-WgFbkRzj.mjs → status-BL7jVyAB.mjs} +535 -447
  144. package/dist/status-CSi6tlRq.mjs +2 -0
  145. package/dist/{status-BTA7kKiQ.mjs → status-DqEUSSxs.mjs} +6 -4
  146. package/dist/{status-watch-C23ILtf9.mjs → status-watch-GDCfqpTE.mjs} +187 -22
  147. package/dist/status-worker.d.mts +1 -0
  148. package/dist/status-worker.mjs +19 -0
  149. package/dist/stim-desktop-C12we7lz.mjs +112 -0
  150. package/dist/{stop-DR6VoDIk.mjs → stop-Bk_1qiV6.mjs} +2 -2
  151. package/dist/{stop-BNmBMi1F.mjs → stop-CPzlM1L-.mjs} +138 -98
  152. package/dist/{stop-DPEhunlw.mjs → stop-D7h6jAXQ.mjs} +11 -10
  153. package/dist/supervisor-run.d.mts +8 -17
  154. package/dist/supervisor-run.mjs +63 -27
  155. package/dist/{support-DMTqj3Hm.mjs → support-67vraa1Q.mjs} +18 -11
  156. package/dist/{support-CwjbFs9H.mjs → support-Dlu37g6H.mjs} +12 -12
  157. package/dist/{swiftpm-macos-DRNVJWlb.mjs → swiftpm-macos-p8WZbxKU.mjs} +35 -24
  158. package/dist/toolchain-DhKwp9iI.mjs +2 -0
  159. package/dist/toolchain-Hp9sCpK4.mjs +873 -0
  160. package/dist/{trigger-CigAYjeL.mjs → trigger-BAahxUPq.mjs} +20 -5
  161. package/dist/trigger-Bf3uDcpv.mjs +2 -0
  162. package/dist/{warm-progress-BuY-Fvfn.mjs → warm-progress-BHX5r0Ei.mjs} +250 -156
  163. package/dist/{web-BDBMxDpx.mjs → web-CJmIj6AI.mjs} +18 -13
  164. package/dist/web-DknQETPs.mjs +2 -0
  165. package/dist/web-run.mjs +11 -12
  166. package/dist/windows-report.d.mts +1 -0
  167. package/dist/windows-report.mjs +18 -0
  168. package/dist/windows-report.ps1 +43 -0
  169. package/dist/workspace-process-lock-1_1OoVW5.mjs +57 -0
  170. package/dist/{workspace-state-DJt_MMvf.mjs → workspace-state-Cjuigeeu.mjs} +62 -58
  171. package/dist/{workspaces-C36s2jb9.mjs → workspaces-BccMFmGQ.mjs} +1188 -1079
  172. package/dist/worktree-CK2MpJW5.mjs +2 -0
  173. package/dist/{worktree-CgvJYJ-Q.mjs → worktree-DQ6Zi2Mv.mjs} +304 -53
  174. package/dist/xcode-Zlx3qjEs.mjs +896 -0
  175. package/package.json +7 -5
  176. package/shim/android-optimizations.gradle +7 -5
  177. package/dist/activity-BSV745Kz.mjs +0 -629
  178. package/dist/api-qvOzWyfO.mjs +0 -154
  179. package/dist/api-run.mjs +0 -294
  180. package/dist/app-install-BIKtMfPq.mjs +0 -896
  181. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  182. package/dist/budget-f7516Zk0.mjs +0 -4106
  183. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  184. package/dist/cancellation-C_22VQTH.mjs +0 -24
  185. package/dist/client-qQAaXSUs.mjs +0 -1771
  186. package/dist/config-BYDxlMY3.mjs +0 -562
  187. package/dist/device-DuiPJQSn.mjs +0 -290
  188. package/dist/device-lease-BX1sJQ2E.mjs +0 -1224
  189. package/dist/device-remote-xRT0Vmo9.mjs +0 -1272
  190. package/dist/eas-session-ledger-Cm0Gwq2F.mjs +0 -207
  191. package/dist/exec-DqKo9GKJ.mjs +0 -268
  192. package/dist/git-DDfFzkMm.mjs +0 -45
  193. package/dist/launch-verify-B6Q8hZP-.mjs +0 -428
  194. package/dist/logs-BGrEUaEs.mjs +0 -383
  195. package/dist/miss-reason-mKzZ4VvN.mjs +0 -238
  196. package/dist/native-android-D5qc3-_v.mjs +0 -226
  197. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  198. package/dist/plan-C4TjdPsR.mjs +0 -260
  199. package/dist/prebuild-DYbucPXy.mjs +0 -212
  200. package/dist/preview-78a9kR_-.mjs +0 -1011
  201. package/dist/react-native-build-CtCccJtb.mjs +0 -239
  202. package/dist/react-native-doctor-CfRnFfjs.mjs +0 -78
  203. package/dist/remote-cache-OyOyVIS3.mjs +0 -526
  204. package/dist/result-CaJg5Iat.mjs +0 -186
  205. package/dist/server-expo-Bigriskl.mjs +0 -2
  206. package/dist/settings-BORNaaCO.mjs +0 -402
  207. package/dist/spawn-claims-DVS5RkMS.mjs +0 -72
  208. package/dist/stage-KNTQopqv.mjs +0 -157
  209. package/dist/stim-desktop-BzBN2Em2.mjs +0 -63
  210. package/dist/tailnet-Dh-qiYzG.mjs +0 -265
  211. package/dist/toolchain-BFkAcstd.mjs +0 -2
  212. package/dist/toolchain-DxSsNssu.mjs +0 -1657
  213. package/dist/trigger-9_USgmxz.mjs +0 -2
  214. package/dist/web-Dq-i3wzJ.mjs +0 -2
  215. package/dist/worktree-DpLdCHga.mjs +0 -2
  216. package/dist/{api-run.d.mts → doctor-fingerprint.d.mts} +0 -0
  217. package/dist/{errors-DzkMYh8Q.mjs → errors-ccaPc4ox.mjs} +2 -2
@@ -1,22 +1,24 @@
1
- import { j as ownership_claim_exports } from "./config-BYDxlMY3.mjs";
2
- import { A as providerDownloadPath, 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 { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-zdKiYQ3E.mjs";
12
- import { c as formatDiagnostic } from "./gradle-DSrXb6lG.mjs";
13
- import { a as PLATFORM, h as displayPath } from "./support-DMTqj3Hm.mjs";
14
- import { i as AndroidRecipeRefusal } from "./plan-C4TjdPsR.mjs";
1
+ import { d as withDrainingCancellation, f as ownership_claim_exports } from "./exec-_UbtCQcG.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-B1UrjZHL.mjs";
4
+ import { en as throwIfCancelled } from "./settings-CsJDEXgK.mjs";
5
+ import { Hn as isEasAuthFailureText, Ln as RESOLVE_TIMEOUT_MS, Vn as easAuthNote } from "./budget-Bs6SxxzO.mjs";
6
+ import { d as runCancellationSignal, r as cancelledFailure } from "./native-run-DY_RLx3C.mjs";
7
+ import { d as prepareProviderDownloadDir, f as providerDownloadPath } from "./build-cache-DmyR9Zzc.mjs";
8
+ import { n as CCACHE_UNAVAILABLE, r as ccacheActivityLine, t as CCACHE_NOT_RUN } from "./ccache-BJRZ9pG3.mjs";
9
+ import { c as offloadPlacement, i as closeOffload, l as placementLoad, n as buildPlacementCandidates, o as offloadBuild, r as chooseBuildMachine, u as remotePhaseText } from "./client-UXD70ZbM.mjs";
10
+ import { a as requireLocalBuild, r as namedBuildMachine, t as OffloadRefusal } from "./selection-CSl9i5qU.mjs";
11
+ import { f as formatDiagnostic } from "./react-native-build-rhk4smwQ.mjs";
12
+ import { c as skippedMissReason } from "./prebuild-uD_ipCxF.mjs";
13
+ import { t as buildPlacementRecord } from "./placement-log-BqGbTa61.mjs";
14
+ import { t as acquireArtifact } from "./acquire-artifact-CD4lbiWE.mjs";
15
+ import { a as PLATFORM, h as displayPath } from "./support-67vraa1Q.mjs";
16
+ import { t as AndroidRecipeRefusal } from "./android-project-BCAAmMwz.mjs";
15
17
  import { rmSync } from "node:fs";
16
18
  import { join } from "node:path";
17
19
  import { machineCapacity } from "@stim-cli/core/state";
18
- import { createWarnOnce, resolveTieredBuild, storeTieredBuild } from "@stim-cli/cache";
19
20
  import chalk from "chalk";
21
+ import { PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, buildResolveTimeoutMs, buildUploadTimeoutMs, createWarnOnce, resolveTieredBuild, storeTieredBuild, timeoutFromEnv } from "@stim-cli/cache";
20
22
  //#region src/commands/android/artifact.ts
21
23
  const FALLBACK_LINES = 5;
22
24
  function fail(code, message, remedy, extra = {}) {
@@ -27,10 +29,10 @@ function fail(code, message, remedy, extra = {}) {
27
29
  extra
28
30
  };
29
31
  }
30
- async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOffloadRefusal, buildPlan, cacheProviderConfig, requestedBuildCache, easBuild, androidPackage: initialPackage, record, maxBuilds, progress }, { acquireLock, releaseLock, waitForBuild, easAuth, resolveRemoteBuild, uploadRemoteBuild, loadCacheProviderModule, acquireSlot, releaseSlot, now }) {
32
+ async function acquireAndroidArtifact({ context, root, buildLog, writer, recipe, targetOffloadRefusal, buildPlan, cacheProviderConfig, requestedBuildCache, easBuild, androidPackage: initialPackage, record, maxBuilds, progress }, { acquireLock, releaseLock, waitForBuild, easAuth, resolveRemoteBuild, uploadRemoteBuild, loadCacheProviderModule, acquireSlot, releaseSlot, now }) {
31
33
  const { phase, out, stats, step, miss, hit: lateHit, place, waitingOn, waitingFor } = progress;
32
34
  let fallbackMachine = null;
33
- let hereReason = "no remote Mac is paired";
35
+ let hereReason = "no remote machine is paired";
34
36
  let slotWaitMs;
35
37
  const buildMachine = record.buildMachine ?? "auto";
36
38
  const fallBack = (reason, line = reason, info = {}) => {
@@ -51,7 +53,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
51
53
  phase("build", `${line} -> building here`);
52
54
  };
53
55
  const { variant, cache: cachePolicy } = buildPlan;
54
- const signal = runCancellationSignal() ?? new AbortController().signal;
56
+ const signal = runCancellationSignal(context) ?? context.signal;
55
57
  const cacheTarget = (key) => ({
56
58
  projectRoot: root,
57
59
  platform: "android",
@@ -63,28 +65,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
63
65
  let androidPackage = initialPackage;
64
66
  let ccacheActivity = CCACHE_NOT_RUN;
65
67
  let phaseFailure = null;
66
- let buildLock = null;
67
- const releaseHeldLock = () => {
68
- if (!buildLock) return;
69
- const held = buildLock;
70
- buildLock = null;
71
- try {
72
- releaseLock(held);
73
- } catch (err) {
74
- out(phaseLine("build", chalk.dim(`could not release the build lock at ${held.path}: ${err?.message || err}`)));
75
- }
76
- };
77
- let buildSlot = null;
78
- const releaseHeldSlot = () => {
79
- if (!buildSlot) return;
80
- const held = buildSlot;
81
- buildSlot = null;
82
- try {
83
- releaseSlot(held);
84
- } catch (err) {
85
- out(phaseLine("build", chalk.dim(`could not release the build slot: ${err?.message || err}`)));
86
- }
87
- };
68
+ let run;
88
69
  let hash = "";
89
70
  let providerUpload = null;
90
71
  let providerName = null;
@@ -92,7 +73,15 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
92
73
  const cacheWarn = createWarnOnce((line) => phase("cache", chalk.yellow(line)));
93
74
  const loadTieredProvider = cachePolicy.remote && cacheProviderConfig ? () => providerLoad ??= loadCacheProviderModule({
94
75
  projectRoot: root,
95
- config: cacheProviderConfig
76
+ config: cacheProviderConfig,
77
+ timeoutMs: timeoutFromEnv(PROVIDER_LOAD_TIMEOUT_ENV, PROVIDER_LOAD_TIMEOUT_MS, context.env)
78
+ }).then((loaded) => {
79
+ if (!loaded.provider || !recipe.providerCache) return loaded;
80
+ const builds = recipe.providerCache(loaded.provider);
81
+ return {
82
+ ...loaded,
83
+ provider: builds ? { builds } : {}
84
+ };
96
85
  }) : null;
97
86
  let cacheKey = "";
98
87
  let storeHash = "";
@@ -140,7 +129,8 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
140
129
  record.cacheKey = cacheKey;
141
130
  storeHash = hash;
142
131
  storeKey = cacheKey;
143
- const found = await resolveTieredBuild({
132
+ const found = await withDrainingCancellation(context, signal, () => resolveTieredBuild({
133
+ timeoutMs: buildResolveTimeoutMs(context.env),
144
134
  local: recipe.cache(),
145
135
  loadProvider: loadTieredProvider,
146
136
  target: {
@@ -149,10 +139,11 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
149
139
  key: cacheKey
150
140
  },
151
141
  destinationDir: providerDownloadPath(workspaceDir(root)),
152
- ensureDestination: prepareProviderDownloadDir,
142
+ ensureDestination: (dir) => prepareProviderDownloadDir(dir, root),
153
143
  skipRead: !useBuildCache,
154
- warn: cacheWarn
155
- });
144
+ warn: cacheWarn,
145
+ signal
146
+ }));
156
147
  const cached = found?.tier === "local" ? found.path : null;
157
148
  record.cacheHit = cached ? "local" : false;
158
149
  record.cacheSkipped = !useBuildCache;
@@ -175,7 +166,8 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
175
166
  if (loaded?.unavailable) phase("cache", chalk.yellow(`provider not usable: ${loaded.unavailable}`));
176
167
  else if (loaded?.provider) remote = loaded;
177
168
  if (remote?.name === "eas") {
178
- const auth = easAuth({
169
+ const auth = await easAuth({
170
+ context,
179
171
  projectRoot: root,
180
172
  owner: loaded?.owner || null
181
173
  });
@@ -187,6 +179,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
187
179
  if (remote && useBuildCache) {
188
180
  const remoteTimer = stepTimer(now);
189
181
  const hit = await resolveRemoteBuild({
182
+ context,
190
183
  logWriter: writer,
191
184
  provider: remote.provider,
192
185
  platform: PLATFORM,
@@ -203,6 +196,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
203
196
  overwrite: false
204
197
  }) ?? null;
205
198
  } catch (err) {
199
+ throwIfCancelled(signal, "build cache backfill");
206
200
  phase("cache", chalk.yellow(`remote hit could not be stored locally: ${err?.message || err}`));
207
201
  }
208
202
  apkPath = stored || hit.appPath;
@@ -224,16 +218,9 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
224
218
  let releasedWait = null;
225
219
  async function awaitSharedBuild() {
226
220
  if (!useBuildCache) return null;
227
- const shared = await waitForSharedBuild({
228
- platform: PLATFORM,
221
+ const shared = await run.claimSharedBuild({
229
222
  key: cacheKey,
230
223
  fingerprint: hash,
231
- root,
232
- logFile: buildLog,
233
- command: "stim android",
234
- acquire: acquireLock,
235
- wait: waitForBuild,
236
- now,
237
224
  phase: (text) => {
238
225
  step("wait");
239
226
  phase("build", text);
@@ -247,7 +234,6 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
247
234
  phaseFailure = fail(code, message, remedy, { lastBuildStatus: true });
248
235
  throw new AndroidRecipeRefusal(phaseFailure);
249
236
  }
250
- buildLock = shared.lock;
251
237
  releasedWait = shared.released;
252
238
  if (shared.hit) {
253
239
  apkPath = shared.hit.path;
@@ -256,26 +242,17 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
256
242
  }
257
243
  return apkPath;
258
244
  }
259
- let swapDir = null;
260
- const releaseArtifact = () => {
261
- if (!swapDir) return;
262
- try {
263
- rmSync(swapDir, {
264
- recursive: true,
265
- force: true
266
- });
267
- swapDir = null;
268
- } catch (error) {
269
- out(phaseLine("cleanup", chalk.yellow(`could not remove the temporary APK: ${error.message}`)));
270
- }
271
- };
272
245
  const installableCachedApk = async (key, cachedPath) => {
273
246
  const prepared = await recipe.materialize(key, cachedPath);
274
247
  if (!prepared) {
275
248
  swapFellBack = true;
276
249
  return null;
277
250
  }
278
- swapDir = prepared.directory;
251
+ if (prepared.directory) run.own(prepared.directory);
252
+ if (prepared.androidPackage) {
253
+ androidPackage = prepared.androidPackage;
254
+ record.bundleId = androidPackage;
255
+ }
279
256
  return prepared.apkPath;
280
257
  };
281
258
  async function prepareCachedArtifact(cachedPath) {
@@ -316,16 +293,15 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
316
293
  requireLocalBuild(buildMachine);
317
294
  if (!maxBuilds) return true;
318
295
  try {
319
- buildSlot = await acquireSlot({
296
+ slotWaitMs = (await run.takeBuildSlot({
297
+ signal,
320
298
  automatic: buildMachine === "auto",
321
299
  max: maxBuilds,
322
- root,
323
- logFile: buildLog,
324
300
  out,
325
301
  waitingFor: (info) => waitingFor?.(info, "build-slot")
326
- });
327
- slotWaitMs = buildSlot.slotWaitMs;
302
+ })).slotWaitMs;
328
303
  } catch (err) {
304
+ throwIfCancelled(signal, "Android build");
329
305
  requireLocalBuild(buildMachine);
330
306
  const refusal = (0, ownership_claim_exports.claimFailure)(err, "stim android");
331
307
  if (refusal) {
@@ -336,7 +312,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
336
312
  }
337
313
  return true;
338
314
  }
339
- /** Whether this build should leave this Mac, before any machine is asked; null builds here. */
315
+ /** Whether this build should leave this machine, before any machine is asked; null builds here. */
340
316
  function placeBuild() {
341
317
  if (cacheIneligible && !recipe.offload?.supportsUncachedArtifacts) {
342
318
  if (namedBuildMachine(buildMachine)) throw new OffloadRefusal(buildMachine, cacheIneligible);
@@ -376,13 +352,12 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
376
352
  machines
377
353
  };
378
354
  }
379
- const openOffload = { choice: null };
380
355
  /** Asks the paired machines once the post-mutation key is known; null builds here. */
381
356
  async function chooseMachine(candidate) {
382
357
  let asked = [];
383
358
  let target;
384
359
  try {
385
- target = recipe.offload.target();
360
+ target = await recipe.offload.target();
386
361
  } catch (error) {
387
362
  fallBack(error.message);
388
363
  return null;
@@ -406,7 +381,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
406
381
  });
407
382
  return null;
408
383
  }
409
- openOffload.choice = choice;
384
+ run.openOffload(() => closeOffload(choice));
410
385
  writer.write(buildPlacementRecord({
411
386
  platform: PLATFORM,
412
387
  buildMachine,
@@ -421,7 +396,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
421
396
  }
422
397
  /** Builds on the chosen machine and stores the APK under the post-mutation key; false builds here instead unless a machine was named. */
423
398
  async function compileElsewhere(choice, candidate) {
424
- const uncached = Boolean(cacheIneligible && recipe.offload?.supportsUncachedArtifacts);
399
+ const uncached = Boolean(recipe.offload?.uncachedArtifacts || cacheIneligible && recipe.offload?.supportsUncachedArtifacts);
425
400
  if ((!storeKey || !storeHash) && !uncached) {
426
401
  const reason = "the build fingerprint or cache key is unavailable";
427
402
  if (namedBuildMachine(buildMachine)) fallBack(reason, reason, { machine: choice.machine });
@@ -438,7 +413,7 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
438
413
  return false;
439
414
  }
440
415
  const stagingDir = join(workspaceDir(root), "offload", PLATFORM);
441
- if (uncached) swapDir = stagingDir;
416
+ const disownStaging = uncached ? run.own(stagingDir) : null;
442
417
  const outcome = await offloadBuild({
443
418
  choice,
444
419
  expectedFingerprint: uncached ? null : storeHash,
@@ -475,7 +450,6 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
475
450
  else {
476
451
  stored = outcome.artifactPath;
477
452
  androidPackage = outcome.androidPackage;
478
- swapDir = stagingDir;
479
453
  }
480
454
  } else try {
481
455
  stored = await recipe.cache().store({
@@ -487,15 +461,16 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
487
461
  reason = `could not store the APK: ${err?.message || err}`;
488
462
  }
489
463
  }
490
- try {
491
- if (!uncached || !stored) {
464
+ if (!uncached || !stored) {
465
+ disownStaging?.();
466
+ try {
492
467
  rmSync(stagingDir, {
493
468
  recursive: true,
494
469
  force: true
495
470
  });
496
- if (swapDir === stagingDir) swapDir = null;
497
- }
498
- } catch {}
471
+ } catch {}
472
+ }
473
+ throwIfCancelled(signal, "offloaded build cache copy");
499
474
  step("compile");
500
475
  if (!outcome.ok || !stored) {
501
476
  const why = reason ?? "the APK was not stored";
@@ -514,6 +489,12 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
514
489
  return false;
515
490
  }
516
491
  const { timings } = outcome;
492
+ if (uncached) {
493
+ record.fingerprint = null;
494
+ record.cacheKey = null;
495
+ record.cacheHit = false;
496
+ record.cacheSkipped = true;
497
+ }
517
498
  apkPath = stored;
518
499
  handoff = outcome.handoff ?? null;
519
500
  record.builtOn = outcome.machine;
@@ -660,7 +641,8 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
660
641
  if (cachePolicy.write) {
661
642
  const local = recipe.cache(true);
662
643
  try {
663
- const stored = await storeTieredBuild({
644
+ const stored = await withDrainingCancellation(context, signal, () => storeTieredBuild({
645
+ timeoutMs: buildUploadTimeoutMs(context.env),
664
646
  local,
665
647
  loadProvider: loadTieredProvider,
666
648
  target: {
@@ -670,15 +652,20 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
670
652
  },
671
653
  sourcePath: artifactPath,
672
654
  overwrite: !useBuildCache || swapFellBack,
673
- warn: cacheWarn
674
- });
675
- providerUpload = stored.providerUpload;
655
+ warn: cacheWarn,
656
+ signal
657
+ }));
658
+ const pending = stored.providerUpload;
659
+ providerUpload = pending ? withDrainingCancellation(context, signal, () => pending) : null;
660
+ providerUpload?.catch(() => {});
676
661
  providerName = stored.providerName ?? providerName;
677
662
  } catch (err) {
663
+ throwIfCancelled(signal, "build cache storage");
678
664
  phase("cache", chalk.yellow(`could not store the build: ${err?.message || err}`));
679
665
  }
680
666
  }
681
667
  if (remote) uploadPending = uploadRemoteBuild({
668
+ context,
682
669
  logWriter: writer,
683
670
  provider: remote.provider,
684
671
  platform: PLATFORM,
@@ -688,73 +675,96 @@ async function acquireAndroidArtifact({ root, buildLog, writer, recipe, targetOf
688
675
  runOptions: recipe.legacyCache?.runOptions ?? null
689
676
  });
690
677
  }
691
- try {
692
- apkPath = await runArtifactLifecycle({
693
- resolve: async () => {
694
- if (!await resolveInitialFingerprint()) throw new AndroidRecipeRefusal(phaseFailure);
695
- if (easBuild) return {
696
- kind: "ready",
697
- artifact: apkPath
698
- };
699
- await resolveRemoteArtifact();
700
- if (apkPath) return {
701
- kind: "cached",
702
- artifact: apkPath
703
- };
704
- miss(reasonForMiss([]).reason);
705
- return { kind: "miss" };
706
- },
707
- claim: useBuildCache ? awaitSharedBuild : void 0,
708
- reuse: async (cached) => {
709
- apkPath = await prepareCachedArtifact(cached);
710
- if (apkPath) lateHit();
711
- else if (swapFellBack) miss(reasonForMiss([]).reason);
712
- return apkPath;
713
- },
714
- build: {
715
- placement: {
716
- select: placeBuild,
717
- acquire: acquireRemoteArtifact
678
+ const acquired = await acquireArtifact({
679
+ platform: PLATFORM,
680
+ command: "stim android",
681
+ lifecycle: (driver) => {
682
+ run = driver;
683
+ return {
684
+ resolve: async () => {
685
+ if (!await resolveInitialFingerprint()) throw new AndroidRecipeRefusal(phaseFailure);
686
+ if (easBuild) return {
687
+ kind: "ready",
688
+ artifact: apkPath
689
+ };
690
+ await resolveRemoteArtifact();
691
+ if (apkPath) return {
692
+ kind: "cached",
693
+ artifact: apkPath
694
+ };
695
+ miss(reasonForMiss([]).reason);
696
+ return { kind: "miss" };
718
697
  },
719
- admit: async () => {
720
- if (!await takeBuildSlot()) throw new AndroidRecipeRefusal(phaseFailure);
698
+ claim: useBuildCache ? awaitSharedBuild : void 0,
699
+ reuse: async (cached) => {
700
+ apkPath = await prepareCachedArtifact(cached);
701
+ if (apkPath) lateHit();
702
+ else if (swapFellBack) miss(reasonForMiss([]).reason);
703
+ return apkPath;
721
704
  },
722
- prepare: prepareSource,
723
- revalidate: revalidateSource,
724
- compile: compileHere,
725
- validate: validateCompiled,
726
- store: storeArtifact
727
- },
728
- release: () => {
729
- if (openOffload.choice) closeOffload(openOffload.choice);
730
- releaseHeldLock();
731
- releaseHeldSlot();
732
- }
733
- });
734
- } catch (error) {
735
- releaseArtifact();
736
- if (error instanceof OffloadRefusal) {
737
- const { code, message, remedy } = error;
738
- return {
739
- ok: false,
740
- failure: fail(code, message, remedy, { lastBuildStatus: true }),
741
- ccache: ccacheActivity
705
+ build: {
706
+ placement: {
707
+ select: placeBuild,
708
+ acquire: acquireRemoteArtifact
709
+ },
710
+ admit: async () => {
711
+ if (!await takeBuildSlot()) throw new AndroidRecipeRefusal(phaseFailure);
712
+ },
713
+ prepare: prepareSource,
714
+ revalidate: revalidateSource,
715
+ compile: compileHere,
716
+ validate: validateCompiled,
717
+ store: storeArtifact
718
+ }
742
719
  };
720
+ },
721
+ settleFailed: async () => {
722
+ await Promise.allSettled([uploadPending, providerUpload]);
723
+ },
724
+ refuse: (error) => {
725
+ if (error instanceof OffloadRefusal) {
726
+ const { code, message, remedy } = error;
727
+ return fail(code, message, remedy, { lastBuildStatus: true });
728
+ }
729
+ if (error instanceof AndroidRecipeRefusal) return error.failure;
730
+ const cancelled = cancelledFailure(context, PLATFORM, {
731
+ code: "STIM_CANCELLED",
732
+ message: "during app preparation"
733
+ });
734
+ return cancelled ? fail(cancelled.code, cancelled.message, cancelled.remedy, { lastBuildStatus: true }) : null;
735
+ },
736
+ releaseFailed: (subject, err) => out(phaseLine("build", chalk.dim(`could not release ${subject}: ${err?.message || err}`))),
737
+ temporaryReleaseFailed: (error) => out(phaseLine("cleanup", chalk.yellow(`could not remove the temporary APK: ${error.message}`)))
738
+ }, {
739
+ root,
740
+ logFile: buildLog,
741
+ deps: {
742
+ acquireBuildLock: acquireLock,
743
+ releaseBuildLock: releaseLock,
744
+ waitForBuild,
745
+ acquireBuildSlot: acquireSlot,
746
+ releaseBuildSlot: releaseSlot,
747
+ now
743
748
  }
744
- if (error instanceof AndroidRecipeRefusal) return {
745
- ok: false,
746
- failure: error.failure,
747
- ccache: ccacheActivity
748
- };
749
- throw error;
750
- }
749
+ });
750
+ if (!acquired.ok) return {
751
+ ok: false,
752
+ failure: acquired.failure,
753
+ ccache: ccacheActivity
754
+ };
751
755
  return {
752
756
  ok: true,
753
757
  artifact: {
754
- apkPath,
758
+ apkPath: acquired.artifact,
755
759
  handoff,
756
760
  androidPackage,
757
- release: releaseArtifact,
761
+ release: async () => {
762
+ try {
763
+ await Promise.allSettled([providerUpload, remote?.provider && "easCli" in remote.provider ? uploadPending : null]);
764
+ } finally {
765
+ acquired.release();
766
+ }
767
+ },
758
768
  waitedForBuild,
759
769
  ccache: ccacheActivity,
760
770
  uploadPending,
@@ -1,23 +1,25 @@
1
- import { p as getProject } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { t as spawnEntry } from "./spawn-entry-Dcb7sDUz.mjs";
4
- import { a as SETTING_SHAPE_REMEDY, j as metroPortSetting, rt as webSettings } from "./settings-B717odTD.mjs";
5
- import { r as readWorkspaceState, w as workspaceLogsDir, x as workspaceDir } from "./workspace-state-DJt_MMvf.mjs";
6
- import { l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
7
- import { _ as detectIsExpo, y as isPackageResolvable } from "./project-_phNIJfs.mjs";
8
- import { u as resolveProjectMetro } from "./metro-DnCEjCxs.mjs";
9
- import { P as resolveSupervisorTarget, _ as teardownBrowserHeld } from "./workspaces-C36s2jb9.mjs";
10
- import { a as withWorkspaceProcessLock, i as reserveBrowserPort, n as getNamedPort } from "./named-ports-4WopRPg-.mjs";
11
- import { t as cancellableSleep } from "./cancellation-C_22VQTH.mjs";
12
- import { s as readNdjsonGenerations } from "./ndjson-GOnbyvso.mjs";
13
- import { o as resolveWorkspaceMetroPort } from "./start-BWqzODpb.mjs";
14
- import { n as windowsLauncherArgs } from "./detached-entry-B9C_zeQC.mjs";
15
- import { d as webLogFile, o as readWebRecord, p as webSupervisorLogFile, s as updateWebRecord } from "./state-D1Icyjlu.mjs";
16
- import { c as readMetroRecords } from "./launch-verify-B6Q8hZP-.mjs";
17
- import { n as sendToOwnedPage, t as liveWebRecord } from "./page-DRHy329N.mjs";
18
- import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-BnzZMqsR.mjs";
19
- import { mkdirSync, openSync } from "node:fs";
1
+ import { t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
+ import { d as workspaceDir, m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
3
+ import { p as getProject } from "./config-CYcBF478.mjs";
4
+ import { l as phaseLine } from "./command-output-B1UrjZHL.mjs";
5
+ import { r as readWorkspaceState } from "./workspace-state-Cjuigeeu.mjs";
6
+ import { Qt as cancellableSleep, a as SETTING_SHAPE_REMEDY, at as webSettings, j as metroPortSetting } from "./settings-CsJDEXgK.mjs";
7
+ import { b as isPackageResolvable, v as detectIsExpo } from "./project-BZNjmW_8.mjs";
8
+ import { s as readNdjsonGenerations } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { f as resolveProjectMetro } from "./metro-DEXpIhHC.mjs";
10
+ import { f as webLogFile, m as webSupervisorLogFile, o as readWebRecord, s as updateWebRecord } from "./state-C4ZtUisW.mjs";
11
+ import { en as readMetroRecords } from "./budget-Bs6SxxzO.mjs";
12
+ import { T as teardownBrowserHeld, m as resolveSupervisorTarget } from "./workspaces-BccMFmGQ.mjs";
13
+ import { t as withWorkspaceProcessLock } from "./workspace-process-lock-1_1OoVW5.mjs";
14
+ import { i as reserveBrowserPort, n as getNamedPort } from "./named-ports-BWTzt6mu.mjs";
15
+ import { n as sendToOwnedPage, t as liveWebRecord } from "./page-CPaHeYqj.mjs";
16
+ import { a as findChrome, t as CHROME_INSTALL_REMEDY } from "./chrome-B6tfCta1.mjs";
17
+ import { o as resolveWorkspaceMetroPort } from "./start-7lpH7hmN.mjs";
18
+ import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
19
+ import { n as windowsLauncherArgs } from "./detached-entry-DFRyG1_o.mjs";
20
20
  import { randomUUID } from "node:crypto";
21
+ import { mkdirSync, openSync } from "node:fs";
22
+ import { ambientEnv } from "@stim-cli/core";
21
23
  import chalk from "chalk";
22
24
  //#region src/web/launch.ts
23
25
  const PORT_PLACEHOLDER = /\{port:([^}]*)\}/g;
@@ -183,7 +185,7 @@ function startSupervisor(root, { url, port, config, launchId }) {
183
185
  cwd: root,
184
186
  stdio: "ignore",
185
187
  env: {
186
- ...process.env,
188
+ ...ambientEnv(),
187
189
  ...launcher.env
188
190
  },
189
191
  windowsHide: true
@@ -198,7 +200,7 @@ function startSupervisor(root, { url, port, config, launchId }) {
198
200
  fd,
199
201
  fd
200
202
  ],
201
- env: process.env
203
+ env: ambientEnv()
202
204
  });
203
205
  child.unref?.();
204
206
  return child;
@@ -277,13 +279,13 @@ function failure(code, message, remedy) {
277
279
  };
278
280
  }
279
281
  function browserWebProject(root) {
280
- return { runtime: ({ settings, headed, note }) => ({
282
+ return { runtime: ({ settings, headed, note, context }) => ({
281
283
  async prepare() {
282
284
  const web = webSettings(settings);
283
285
  const usesMetro = web.url === null || web.url.includes("{port:metro}");
284
- const pin = usesMetro ? metroPortSetting(settings) : null;
286
+ const pin = usesMetro ? metroPortSetting(settings, context?.env) : null;
285
287
  if (pin?.error) return failure("STIM_BAD_ARG", pin.error, SETTING_SHAPE_REMEDY);
286
- const chrome = findChrome();
288
+ const chrome = findChrome({ env: context?.env });
287
289
  if (!chrome) return failure("STIM_WEB_NO_CHROME", "Google Chrome or Chromium is not installed.", CHROME_INSTALL_REMEDY);
288
290
  if (web.url === null && !detectIsExpo(root)) return failure("STIM_WEB_NO_URL", "This is not an Expo app, so Stim does not know which page to open.", "Start your web dev server on a named port, then set the page: `stim settings set web.url 'http://localhost:{port:web}/' --scope workspace`. See `stim guide web`.");
289
291
  if (web.url === null && !isPackageResolvable(root, "react-native-web")) return failure("STIM_WEB_DEPS_MISSING", "This Expo app cannot render on the web: react-native-web is not installed.", `Run \`${EXPO_WEB_DEPENDENCIES}\` and \`stim start\`, then run \`stim web\` again.`);