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,50 +1,48 @@
1
- import { E as upsertProject, K as validateDeviceSlot, U as parseDeviceSlotOption, V as deviceSlotPlatforms, j as ownership_claim_exports, p as getProject, u as getConcurrencyLimits, z as deviceSlotFileKey } from "./config-BYDxlMY3.mjs";
2
- import { t as getExecutor } from "./exec-DqKo9GKJ.mjs";
3
- import { I as projectSettingsContext, K as resolveProjectSettings, L as publicUrlSetting, N as metroWarmupUrlSetting, V as remoteEasFallbackSetting, W as resolveCacheProviderConfig, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, ot as detectProviders, q as resolveSettings, tt as tunnelModeSetting } from "./settings-B717odTD.mjs";
4
- import { _ as waitForBuild, g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-BX1sJQ2E.mjs";
5
- import { c as writeWorkspaceState, f as emulatorLogFile, i as recordWorkspaceUse, r as readWorkspaceState$1, w as workspaceLogsDir$1 } from "./workspace-state-DJt_MMvf.mjs";
6
- import { _ as stepTimer, f as refuseNoProject, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
7
- import { I as workspaceDevServerMode, R as writeWorkspaceLaunch, c as projectShortcut, d as projectRegistry, r as findProjectRoot, t as NO_PROJECT_REFUSAL } from "./project-_phNIJfs.mjs";
8
- import { G as probeEmulatorSerial, J as resolveOwnedAvdSerial, O as listAdbDevices, U as physicalDeviceModel, Y as resolvePhysicalDevice, a as androidDeviceAbi, ht as configuredAndroidEmulatorApp, j as listInstalledSystemImages, tt as waitForBoot } from "./android-Mz_Inn3w.mjs";
9
- import { s as pidExists, u as resolveProjectMetro } from "./metro-DnCEjCxs.mjs";
10
- import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-C36s2jb9.mjs";
11
- import { At as createRunRecorder, Ft as recordRunStats, It as statsProjectKey$1, Nt as recordCapacityRefusal, Ot as startBuildProgress, jt as readRunEstimates, kt as tapBuildLog, t as budgetGate, yt as NO_BUILD_PROGRESS } from "./budget-f7516Zk0.mjs";
12
- import { S as withNativeBuildRun, b as runCancellation, p as cancelledFailure, x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
13
- import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
14
- import { f as resolveEasCliBin, i as checkEasAuth, m as uploadRemote, p as resolveRemote } from "./remote-cache-OyOyVIS3.mjs";
15
- import { f as setRemoteLogSink, g as parseBuildMachineOption, y as resolveBuildPlacement } from "./client-qQAaXSUs.mjs";
16
- import { c as startDevServer } from "./start-BWqzODpb.mjs";
17
- import { d as verifyAndroidReleaseLaunch, f as verifyLaunch } from "./launch-verify-B6Q8hZP-.mjs";
18
- import { b as launchAndroidApp, g as installAndroidApp, r as DEFAULT_METRO_PORT, t as ADB_INSTALL_TIMEOUT_MS, x as launchAndroidReleaseApp } from "./app-install-BIKtMfPq.mjs";
19
- import { n as ensureWorkspaceStorageSafely, r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-k8dTIrbK.mjs";
20
- import { n as devicePlacementRecord } from "./placement-log-MOfPVgaM.mjs";
21
- import { t as CCACHE_NOT_RUN } from "./ccache-zdKiYQ3E.mjs";
22
- import { n as DeviceAdmissionRefusal, r as checkDeviceCapacity } from "./device-capacity-CBUAcRyQ.mjs";
23
- import { S as pooledAndroidDevice, a as PLATFORM, b as noDeviceDiagnostic, g as dumpApkManifest, h as displayPath, o as androidBuildOptions, p as apkPackage, r as NO_DEVICE, s as androidDevClientScheme } from "./support-DMTqj3Hm.mjs";
24
- import { r as resolveAndroidRunPlan, t as androidDeviceSelectorRefusal } from "./plan-C4TjdPsR.mjs";
25
- import { t as acquireAndroidArtifact } from "./artifact-D3czlUvT.mjs";
26
- import { a as acquireRunLease, d as runLease, f as waitFlagConflict, o as leaseExpiryText, u as releaseLeaseOnSignal } from "./device-lease-run-Cw2M4z51.mjs";
27
- import { a as reportAndroidResult, i as persistLastBuild, n as finishAndroidUpload } from "./result-CaJg5Iat.mjs";
28
- import { r as hostedMetroSettings } from "./metro-gateway-CX9Xlkq2.mjs";
29
- import { a as writeHostedAndroid, i as writeDevicePlacement, t as readHostedAndroid } from "./ios-state-CBLe1xYw.mjs";
30
- import { a as refusePlan, c as devicePlacementLine, i as printPlan, n as planFlagRefusal, o as checkEasFallback, s as automaticDevicePlacement } from "./build-plan-B7SZsc2N.mjs";
31
- import { n as prepareHostedAndroid, t as placeHostedAndroid } from "./hosted-android-C3MHGld1.mjs";
32
- import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DPt0m9Nd.mjs";
33
- import { S as ownedSessionName, a as ensureMetroReachable, c as remoteAndroidDeps, n as binOnPath, o as ensureRemoteBootOwned, u as resolveRemoteContext } from "./device-remote-xRT0Vmo9.mjs";
34
- import { a as resolveEasDevelopmentBuild, r as isEasBuildFailure } from "./eas-build-JyfqyHfC.mjs";
35
- import { n as verifyCollectorOwnership } from "./ownership-DCtw_2IA.mjs";
36
- import { a as AvdRecoveryError, i as AvdBootError, n as ensureBooted, o as warmMetro, r as ensureOwnedDevice, t as didSetUpDevice } from "./device-BECOiufl.mjs";
37
- import { t as selectFromPool } from "./device-pool-Bf-pOhSw.mjs";
38
- import { r as finishAndroidRun } from "./launch-F4sOqAhB.mjs";
1
+ import { t as getExecutor, x as ownership_claim_exports } from "./exec-DEoAhcze.mjs";
2
+ import { m as workspaceLogsDir$1, t as emulatorLogFile } from "./paths-DQtTgsBf.mjs";
3
+ import { B as deviceSlotFileKey, E as upsertProject, H as deviceSlotPlatforms, W as parseDeviceSlotOption, p as getProject, q as validateDeviceSlot, u as getConcurrencyLimits } from "./config-DlrsduwG.mjs";
4
+ import { _ as stepTimer, f as refuseNoProject, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-gwpm28fu.mjs";
5
+ import { d as writeWorkspaceState, i as recordWorkspaceUse, r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
6
+ import { G as resolveCacheProviderConfig, H as remoteEasFallbackSetting, J as resolveProjectSettingsAsync, L as projectSettingsContextAsync, N as metroWarmupUrlSetting, R as publicUrlSetting, Y as resolveSettings, a as SETTING_SHAPE_REMEDY, ct as detectProviders, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, rt as tunnelModeSetting } from "./settings-C7O8A6ZI.mjs";
7
+ import { L as workspaceDevServerMode, f as projectRegistry, i as findProjectRoot$1, l as projectShortcut, t as NO_PROJECT_REFUSAL, z as writeWorkspaceLaunch } from "./project-wM_XFTvE.mjs";
8
+ import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { c as pidExists, d as resolveProjectMetro } from "./metro-DiXtA3Ty.mjs";
10
+ import { Bn as checkEasAuth, Bt as ensureMetroReachable, Cn as launchAndroidApp, Gt as resolveRemoteContext, H as tapBuildLog, In as runProcessOperation, J as recordRunStats, Jn as resolveRemote, K as recordCapacityRefusal, Lt as binOnPath, M as NO_BUILD_PROGRESS, Pn as exitAfterFlush, U as createRunRecorder, Ut as remoteAndroidDeps, V as startBuildProgress, Vt as ensureRemoteBootOwned, W as readRunEstimates, Y as statsProjectKey$1, Yn as uploadRemote, cn as DEFAULT_METRO_PORT, in as verifyLaunch, qn as resolveEasCliBin, rn as verifyAndroidReleaseLaunch, rr as ownedSessionName, sn as ADB_INSTALL_TIMEOUT_MS, t as budgetGate, wn as launchAndroidReleaseApp, yn as installAndroidApp } from "./budget-Cvwn54qV.mjs";
11
+ import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-NwUuxbkg.mjs";
12
+ import { I as acquireBuildSlot, R as releaseBuildSlot } from "./workspaces-CpANmBlq.mjs";
13
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-CMLmzp7o.mjs";
14
+ import { A as listAdbDevices, I as listInstalledSystemImages, Y as physicalDeviceModel, Z as probeEmulatorSerial, a as androidDeviceAbi, ct as configuredAndroidEmulatorApp, et as resolveOwnedAvdSerialAsync, ot as waitForBoot, tt as resolvePhysicalDevice } from "./android-C7sVmyI9.mjs";
15
+ import { t as CCACHE_NOT_RUN } from "./ccache-Btwc36-I.mjs";
16
+ import { h as setRemoteLogSink } from "./client-OyRoEuSr.mjs";
17
+ import { i as parseBuildMachineOption, s as resolveBuildPlacement } from "./selection-DSMbWEX2.mjs";
18
+ import { r as hostedMetroSettings } from "./metro-gateway-CKZqKqx7.mjs";
19
+ import { a as writeHostedAndroid, i as writeDevicePlacement, t as readHostedAndroid } from "./ios-state-Dtw5K2aI.mjs";
20
+ import { n as prepareHostedAndroid, t as placeHostedAndroid } from "./hosted-android-B-9f-jkd.mjs";
21
+ import { n as verifyCollectorOwnership } from "./ownership-C5fo5Edb.mjs";
22
+ import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CbfmNgM6.mjs";
23
+ import { c as startDevServer } from "./start-EojN4WFz.mjs";
24
+ import { a as acquireRunLease, d as runLease, f as waitFlagConflict, o as leaseExpiryText, u as releaseLeaseOnAbort } from "./device-lease-run-xJPQ_QQG.mjs";
25
+ import { n as DeviceAdmissionRefusal, r as checkDeviceCapacity } from "./device-capacity-DK5_EwRS.mjs";
26
+ import { a as resolveEasDevelopmentBuild, r as isEasBuildFailure } from "./eas-build-CwknaQYj.mjs";
27
+ import { n as ensureWorkspaceStorageSafely, r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-B7KIafpM.mjs";
28
+ import { n as devicePlacementRecord } from "./placement-log-BnGgJRRZ.mjs";
29
+ import { S as pooledAndroidDevice, a as PLATFORM, b as noDeviceDiagnostic, g as dumpApkManifest, h as displayPath, o as androidBuildOptions, p as apkPackage, r as NO_DEVICE, s as androidDevClientScheme } from "./support-yUiOjnVY.mjs";
30
+ import { t as acquireAndroidArtifact } from "./artifact-DJPy518Y.mjs";
31
+ import { a as reportAndroidResult, c as resolveAndroidRunPlan, i as persistLastBuild, n as finishAndroidUpload, o as androidDeviceSelectorRefusal } from "./result-D2Ykz_iD.mjs";
32
+ import { n as automaticDevicePlacement, r as devicePlacementLine, t as checkEasFallback } from "./eas-fallback-CSgAulr5.mjs";
33
+ import { a as AvdRecoveryError, i as AvdBootError, n as ensureBooted, o as warmMetro, r as ensureOwnedDevice, t as didSetUpDevice } from "./device-B-L3Fbxy.mjs";
34
+ import { t as selectFromPool } from "./device-pool-BMkdsefq.mjs";
35
+ import { r as finishAndroidRun } from "./launch-CCzXlc8r.mjs";
39
36
  import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
37
+ import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-DUC8Ka9y.mjs";
40
38
  import { basename, join } from "node:path";
41
- import { hostedAndroidStatus, parseMachine } from "@stim-cli/core/state";
42
- import { loadCacheProvider } from "@stim-cli/cache";
43
39
  import { workspaceId } from "@stim-cli/core";
44
- import { InvalidArgumentError } from "commander";
40
+ import { hostedAndroidStatus, parseMachine } from "@stim-cli/core/state";
45
41
  import chalk from "chalk";
42
+ import { InvalidArgumentError } from "commander";
43
+ import { loadCacheProvider } from "@stim-cli/cache";
46
44
  //#region src/commands/android/remote.ts
47
- async function connectAndroidHosting({ root, slot, machine, release, appMode = release ? "release" : "development", metroCheck, selectors, read = readHostedAndroid, resolveSerial = resolveOwnedAvdSerial, prepare = prepareHostedAndroid }) {
45
+ async function connectAndroidHosting({ root, slot, machine, release, appMode = release ? "release" : "development", metroCheck, selectors, read = readHostedAndroid, resolveSerial = resolveOwnedAvdSerialAsync, prepare = prepareHostedAndroid }) {
48
46
  let recorded;
49
47
  try {
50
48
  recorded = read(root, slot)[slot];
@@ -69,12 +67,12 @@ async function connectAndroidHosting({ root, slot, machine, release, appMode = r
69
67
  if (local?.owned && local.avdName) {
70
68
  let running = true;
71
69
  try {
72
- const resolved = resolveSerial(local.avdName, { timeoutMs: 5e3 });
70
+ const resolved = await resolveSerial(local.avdName, { timeoutMs: 5e3 });
73
71
  running = Boolean(resolved.serial) || !resolved.notRunning && !resolved.missing;
74
72
  } catch {}
75
73
  if (running) return { failure: {
76
74
  code: "STIM_BAD_ARG",
77
- message: `This workspace's Android emulator for slot ${slot} runs on this Mac; run stim stop first.`
75
+ message: `This workspace's Android emulator for slot ${slot} runs on this machine; run stim stop first.`
78
76
  } };
79
77
  }
80
78
  try {
@@ -113,7 +111,7 @@ async function selectAndroidPlacement({ target: selected, automatic = automaticD
113
111
  })
114
112
  };
115
113
  }
116
- const refusal = localSelectors(selected);
114
+ const refusal = await localSelectors(selected);
117
115
  if (refusal) return { failure: refusal };
118
116
  try {
119
117
  const placed = await automatic({
@@ -184,7 +182,7 @@ async function selectAndroidPlacement({ target: selected, automatic = automaticD
184
182
  //#endregion
185
183
  //#region src/commands/android/hosted.ts
186
184
  async function finishHostedAndroidRun({ target, artifact, root, slot = "default", release, appMode = release ? "release" : "development", isExpo, metroPort, logsDir, selectors, place, writePlacement, verifyLaunch: verify, writeLaunch, readApkPackage, resolveDevClientScheme, now, started, startedAt, fail, phase, enterPhase, out, recordBuild, ...report }) {
187
- const packageName = artifact.androidPackage ?? readApkPackage(artifact.apkPath);
185
+ const packageName = artifact.androidPackage ?? await readApkPackage(artifact.apkPath);
188
186
  if (!artifact.apkPath || !packageName) return fail("STIM_INSTALL_FAILED", "The built APK has no package identity.");
189
187
  const launchedAt = now();
190
188
  try {
@@ -198,7 +196,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
198
196
  ...appMode === "process" ? { mode: appMode } : {},
199
197
  metroPort,
200
198
  selectors,
201
- ...appMode === "development" && isExpo ? { devClientScheme: resolveDevClientScheme(root, artifact.apkPath) ?? void 0 } : {},
199
+ ...appMode === "development" && isExpo ? { devClientScheme: await resolveDevClientScheme(root, artifact.apkPath) ?? void 0 } : {},
202
200
  reserved: (placement) => writePlacement(root, slot, placement),
203
201
  note: out,
204
202
  enterPhase
@@ -222,7 +220,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
222
220
  metroPort,
223
221
  mode: workspaceDevServerMode(root, isExpo),
224
222
  slot: launchSlotScope(root, slot),
225
- platformShared: siblingPlatformSlots(root, "android", slot).length > 0
223
+ platformShared: (await siblingPlatformSlots(root, "android", slot)).length > 0
226
224
  });
227
225
  if (evidence.fatal) return fail("STIM_LAUNCH_FAILED", "Metro could not deliver the hosted app bundle.", "Run stim logs --errors and fix the bundle error.");
228
226
  launched = evidence.verified ? true : evidence.requested ? "bundling" : "unverified";
@@ -246,6 +244,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
246
244
  ok: true,
247
245
  facts: reportAndroidResult({
248
246
  ...report,
247
+ out,
249
248
  ...appMode === "process" ? { runtimeKind: "process" } : {},
250
249
  root,
251
250
  slot,
@@ -267,7 +266,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
267
266
  })
268
267
  };
269
268
  } catch (error) {
270
- return fail(error.code ?? "STIM_HOSTING_REFUSED", error.message, `Retry stim android --remote ${target.host.machine}, or run stim stop to reconcile the recorded placement.`);
269
+ return fail(error.code ?? "STIM_HOSTING_REFUSED", error.message, `Retry stim android --remote ${target.host.machine}, or run stim stop to reconcile the recorded placement.`, { lastBuildStatus: true });
271
270
  }
272
271
  }
273
272
  //#endregion
@@ -279,28 +278,36 @@ function runOnlyFlag(opts) {
279
278
  if (opts.metroCheck === false) return "--no-metro-check";
280
279
  return null;
281
280
  }
282
- async function planAndroid(opts, overrides = {}) {
281
+ async function readAndroidBuildPlan(operation, opts, overrides = {}) {
283
282
  const deps = {
284
- findRoot: findProjectRoot,
283
+ findRoot: findProjectRoot$1,
285
284
  projectRegistry,
286
285
  ...overrides
287
286
  };
288
- const json = Boolean(opts.json);
289
287
  const flag = runOnlyFlag(opts);
290
- if (flag) return refusePlan(planFlagRefusal(flag), json);
291
- const root = deps.findRoot(process.cwd());
292
- if (!root) return refusePlan(NO_PROJECT_REFUSAL, json);
288
+ if (flag) return { refusal: planFlagRefusal(flag) };
289
+ const root = deps.findRoot(operation.projectRoot);
290
+ if (!root) return { refusal: NO_PROJECT_REFUSAL };
293
291
  const selected = deps.projectRegistry.selectAndroid(root);
294
- if ("problem" in selected) return refusePlan({
292
+ if ("problem" in selected) return { refusal: {
295
293
  code: "STIM_NO_PROJECT",
296
294
  ...selected.problem
297
- }, json);
298
- const resolved = resolveProjectSettings(root);
299
- const project = await selected.load(resolved);
300
- if (!project.plan) return refusePlan(unsupportedPlan("android"), json);
301
- const result = await project.plan(opts, resolved);
295
+ } };
296
+ const resolved = await resolveProjectSettingsAsync(root, {
297
+ env: operation.env,
298
+ signal: operation.signal
299
+ });
300
+ const planner = (await selected.load(resolved)).plan;
301
+ if (!planner) return { refusal: unsupportedPlan("android") };
302
+ operation.signal.throwIfAborted();
303
+ return planner(opts, resolved, operation);
304
+ }
305
+ async function planAndroid(opts, overrides = {}) {
306
+ const json = Boolean(opts.json);
307
+ const { value: result, interrupted } = await runProcessOperation(process.cwd(), (operation) => readAndroidBuildPlan(operation, opts, overrides));
302
308
  if ("platform" in result) printPlan(result, json);
303
309
  else refusePlan(result.refusal, json, result.lines);
310
+ if (interrupted) process.exitCode = interrupted;
304
311
  }
305
312
  //#endregion
306
313
  //#region src/commands/android.ts
@@ -308,38 +315,41 @@ function androidCommand(program) {
308
315
  registerAndroid(program);
309
316
  }
310
317
  function registerAndroid(program) {
311
- program.command("android").description("Build (or install from the shared cache), install and launch this workspace's Android app on its owned emulator. React Native and Expo Debug runs start the dev server when it is not running.").option("--eas-profile <name>", "Download a matching EAS development build; on a miss, print the build command without running it").option("--slot <name>", "Reusable device slot within this workspace (default: default)", parseDeviceSlotOption).option("--remote-build <value>", "Build on auto, local, or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "Emit the facts as a single JSON line on stdout; every other line goes to stderr").option("--plan", "Predict the next build without building, booting or installing: resolve the fingerprint, check the local then remote cache, and print the expected cache result and duration. Writes no Stim state.").option("--no-metro-check", "Skip the reserved-port Metro health check and do not start it (the app will load no bundle unless something else serves it)").option("--no-build-cache", "Build fresh, ignoring cached artifacts (local and the project's build-cache provider); the fresh build still replaces the cache entry").option("--variant <name>", "Gradle variant to assemble and install (e.g. productionDebug on a flavored project); overrides the android.variant setting. A variant ending in Release embeds the JS bundle and skips Metro entirely. Default: debug").option("--system-image <id>", "Android system image to create this workspace's owned AVD from, as the sdkmanager package id (e.g. \"system-images;android-36;google_apis;arm64-v8a\"). Overrides the android.systemImage setting for this invocation. An unknown id refuses with STIM_BAD_ARG and prints the installed images.").option("--device-profile <id>", "Hardware profile to create this workspace's owned AVD with, as an `avdmanager list device -c` id (e.g. \"pixel_fold\", \"pixel_tablet\"). Overrides the android.deviceProfile setting for this invocation. An unknown id refuses with STIM_BAD_ARG and prints the available ids.").option("--device [serial]", "Install and launch on a connected physical device instead of this workspace's owned emulator. With no serial, the first connected device this workspace can lease is used. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or a named approved Mac from remote.machines; auto places on an approved Mac when this Mac is full or busy; local runs here, whatever android.remote says", (value) => {
318
+ program.command("android").description("Build (or install from the shared cache), install and launch this workspace's Android app on its owned emulator. React Native and Expo Debug runs start the dev server when it is not running.").option("--eas-profile <name>", "Download a matching EAS development build; on a miss, print the build command without running it").option("--slot <name>", "Reusable device slot within this workspace (default: default)", parseDeviceSlotOption).option("--remote-build <value>", "Build on auto, local, or one named machine; a name refuses without fallback", parseBuildMachineOption).option("--json", "Emit the facts as a single JSON line on stdout; every other line goes to stderr").option("--plan", "Predict the next build without building, booting or installing: resolve the fingerprint, check the local then remote cache, and print the expected cache result and duration. Writes no Stim state.").option("--no-metro-check", "Skip the reserved-port Metro health check and do not start it (the app will load no bundle unless something else serves it)").option("--no-build-cache", "Build fresh, ignoring cached artifacts (local and the project's build-cache provider); the fresh build still replaces the cache entry").option("--variant <name>", "Gradle variant to assemble and install (e.g. productionDebug on a flavored project); overrides the android.variant setting. A variant ending in Release embeds the JS bundle and skips Metro entirely. Default: debug").option("--system-image <id>", "Android system image to create this workspace's owned AVD from, as the sdkmanager package id (e.g. \"system-images;android-36;google_apis;arm64-v8a\"). Overrides the android.systemImage setting for this invocation. An unknown id refuses with STIM_BAD_ARG and prints the installed images.").option("--device-profile <id>", "Hardware profile to create this workspace's owned AVD with, as an `avdmanager list device -c` id (e.g. \"pixel_fold\", \"pixel_tablet\"). Overrides the android.deviceProfile setting for this invocation. An unknown id refuses with STIM_BAD_ARG and prints the available ids.").option("--device [serial]", "Install and launch on a connected physical device instead of this workspace's owned emulator. With no serial, the first connected device this workspace can lease is used. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or a named approved Mac from remote.machines; auto places on an approved Mac when this machine is full or busy; local runs here, whatever android.remote says", (value) => {
312
319
  if (!parseMachine(value)) throw new InvalidArgumentError("expected eas, proxy, auto, local, or a tailnet machine name");
313
320
  return value;
314
321
  }).option("--wait <seconds>", "How long to wait for another workspace to release the device it leases, before refusing with STIM_DEVICE_BUSY (default 60, 0 refuses at once). Without --device, wait for an owned-device slot (default 600 seconds; --no-wait refuses immediately).").option("--no-wait", "Install on a device another workspace leases instead of waiting: this run takes no lease and, when both workspaces build the same app id, the install terminates the holder's running app. Without --device, refuse a full device cap or existing slot queue immediately.").action(async (opts) => {
315
322
  if (opts.plan) return planAndroid(opts);
316
- const root = findProjectRoot(process.cwd());
323
+ const root = findProjectRoot$1(process.cwd());
317
324
  if (!root) {
318
325
  refuseNoProject({ json: Boolean(opts.json) });
319
326
  return;
320
327
  }
321
- if (!(await runAndroidOperation(root, {
328
+ const { value: result, interrupted } = await runProcessOperation(root, (context) => runAndroidOperation(context, root, {
322
329
  ...opts,
323
330
  waitConflict: waitFlagConflict(process.argv)
324
- })).ok) process.exit(runCancellation() ? 130 : 1);
331
+ }));
332
+ if (!result.ok) process.exit(interrupted ?? 1);
333
+ else if (result.uploadsAbandoned) exitAfterFlush(0);
325
334
  });
326
335
  }
327
- function runAndroidOperation(root, opts = {}) {
328
- return withNativeBuildRun(root, {
336
+ function runAndroidOperation(context, root, opts = {}) {
337
+ return withNativeBuildRun(context, root, {
329
338
  command: "android",
330
339
  platform: PLATFORM,
331
340
  slot: opts.slot ?? "default"
332
341
  }, async (claim) => {
333
- recordWorkspaceUse(root);
342
+ recordWorkspaceUse(root, /* @__PURE__ */ new Date(), context.env, context.cwd);
334
343
  const progress = startBuildProgress({
335
344
  root,
336
345
  platform: PLATFORM,
337
346
  slot: opts.slot ?? "default",
338
347
  claim,
339
- note: (line) => console.error(chalk.dim(line))
348
+ note: (line) => context.output("stderr", `${chalk.dim(line)}\n`)
340
349
  });
341
350
  try {
342
351
  return await runAndroid({
352
+ context,
343
353
  root,
344
354
  buildMachine: opts.remoteBuild,
345
355
  slot: opts.slot,
@@ -359,9 +369,12 @@ function runAndroidOperation(root, opts = {}) {
359
369
  } finally {
360
370
  progress.clear();
361
371
  }
362
- }, { write: (line) => console.error(chalk.dim(phaseLine("lock", line))) });
372
+ }, { write: (line) => context.output("stderr", `${chalk.dim(phaseLine("lock", line))}\n`) });
363
373
  }
364
- function resolveRunAndroidOptions({ root, json = false, remoteDevice: commandRemoteBackend = null, resolveSettingsFor = resolveSettings, resolveRemoteDeviceContext = resolveRemoteContext, remoteDeviceDeps: makeRemoteDeviceDeps = remoteAndroidDeps, resolveEasBin = resolveEasCliBin, ensureMetroReachable: ensureRemoteMetro = ensureMetroReachable, ensureRemoteBootOwned: ensureRemoteOwned = ensureRemoteBootOwned, detectRemoteProviders = detectProviders, metroCheck = true, useBuildCache = true, easProfile, resolveEasDevelopmentBuild: resolveEasBuild = resolveEasDevelopmentBuild, variant: variantFlag = null, systemImage: systemImageFlag = null, deviceProfile: deviceProfileFlag, device: deviceFlag = null, wait: waitFlag = void 0, waitConflict = false, acquireLease = acquireRunLease, makeRunLease = runLease, selectPool = selectFromPool, onLeaseSignal = releaseLeaseOnSignal, listDevices = listAdbDevices, deviceModel = physicalDeviceModel, deviceAbi = androidDeviceAbi, isEmulatorDevice = probeEmulatorSerial, readApkPackage = (apkPath) => apkPackage(dumpApkManifest(apkPath)), getLimits = getConcurrencyLimits, checkCapacity = checkDeviceCapacity, acquireSlot = acquireBuildSlot, releaseSlot = releaseBuildSlot, ensureDevice = ensureOwnedDevice, listSystemImages = listInstalledSystemImages, listDeviceProfiles, ensureDeviceBooted = ensureBooted, resolveAvdSerial = resolveOwnedAvdSerial, waitForDeviceBoot = waitForBoot, dataFreeBytes, trimCaches, wipeDevice, resolveMetro = resolveProjectMetro, warmMetro: prewarmMetro = warmMetro, startServer = startDevServer, readState = readWorkspaceState$1, pidAlive = pidExists, verifyCollector = verifyCollectorOwnership, verifyLaunched = verifyLaunch, ensureStorage = ensureWorkspaceStorageSafely, acquireLock = acquireBuildLock, releaseLock = releaseBuildLock, waitForBuild: waitForBuild$1 = waitForBuild, easAuth = checkEasAuth, resolveRemoteBuild = resolveRemote, uploadRemoteBuild = uploadRemote, resolveCacheProvider = resolveCacheProviderConfig, loadCacheProviderModule = loadCacheProvider, install = installAndroidApp, launch = launchAndroidApp, launchRelease = launchAndroidReleaseApp, verifyReleaseLaunched = verifyAndroidReleaseLaunch, resolveDevClientScheme = androidDevClientScheme, spawn = (cmd, args, opts) => getExecutor().spawn(cmd, args, opts), kill = (pid, signal) => process.kill(pid, signal), createWriter = createNdjsonWriter, writeLaunch = writeWorkspaceLaunch, writeState = writeWorkspaceState, recordBuild, recordStats = recordRunStats, recordCapacityRefusal: recordRefusal, readEstimates = readRunEstimates, now = Date.now, out = (line) => console.error(line), emit = (line) => console.log(line) } = {}) {
374
+ function resolveRunAndroidOptions({ context, root, json = false, remoteDevice: commandRemoteBackend = null, resolveSettingsFor = resolveSettings, resolveRemoteDeviceContext = resolveRemoteContext, remoteDeviceDeps: makeRemoteDeviceDeps = remoteAndroidDeps, resolveEasBin = resolveEasCliBin, ensureMetroReachable: ensureRemoteMetro = ensureMetroReachable, ensureRemoteBootOwned: ensureRemoteOwned = ensureRemoteBootOwned, detectRemoteProviders = detectProviders, metroCheck = true, useBuildCache = true, easProfile, resolveEasDevelopmentBuild: resolveEasBuild = resolveEasDevelopmentBuild, variant: variantFlag = null, systemImage: systemImageFlag = null, deviceProfile: deviceProfileFlag, device: deviceFlag = null, wait: waitFlag = void 0, waitConflict = false, acquireLease = acquireRunLease, makeRunLease = runLease, selectPool = selectFromPool, onLeaseSignal = releaseLeaseOnAbort, listDevices = listAdbDevices, deviceModel = physicalDeviceModel, deviceAbi = androidDeviceAbi, isEmulatorDevice = probeEmulatorSerial, readApkPackage = async (apkPath) => apkPackage(await dumpApkManifest(apkPath, { context })), getLimits = getConcurrencyLimits, checkCapacity = checkDeviceCapacity, acquireSlot = acquireBuildSlot, releaseSlot = releaseBuildSlot, ensureDevice = ensureOwnedDevice, listSystemImages = listInstalledSystemImages, listDeviceProfiles, ensureDeviceBooted = ensureBooted, resolveAvdSerial = resolveOwnedAvdSerialAsync, waitForDeviceBoot = waitForBoot, dataFreeBytes, trimCaches, wipeDevice, resolveMetro = resolveProjectMetro, warmMetro: prewarmMetro = warmMetro, startServer = startDevServer, readState = readWorkspaceState$1, pidAlive = pidExists, verifyCollector = verifyCollectorOwnership, verifyLaunched = verifyLaunch, ensureStorage = ensureWorkspaceStorageSafely, acquireLock = acquireBuildLock, releaseLock = releaseBuildLock, waitForBuild: waitForBuild$1 = waitForBuild, easAuth = checkEasAuth, resolveRemoteBuild = resolveRemote, uploadRemoteBuild = uploadRemote, resolveCacheProvider = resolveCacheProviderConfig, loadCacheProviderModule = loadCacheProvider, install = installAndroidApp, launch = launchAndroidApp, launchRelease = launchAndroidReleaseApp, verifyReleaseLaunched = verifyAndroidReleaseLaunch, resolveDevClientScheme = (projectRoot, apkPath, options) => androidDevClientScheme(projectRoot, apkPath, {
375
+ ...options,
376
+ context
377
+ }), spawn = (cmd, args, opts) => getExecutor().spawn(cmd, args, opts), kill = (pid, signal) => process.kill(pid, signal), createWriter = createNdjsonWriter, writeLaunch = writeWorkspaceLaunch, writeState = writeWorkspaceState, recordBuild, recordStats = recordRunStats, recordCapacityRefusal: recordRefusal, readEstimates = readRunEstimates, now = Date.now, out = (line) => context ? context.output("stderr", `${line}\n`) : console.error(line), emit = (line) => context ? context.output("stdout", `${line}\n`) : console.log(line) } = {}) {
365
378
  return {
366
379
  root,
367
380
  json,
@@ -498,6 +511,7 @@ function avdSetupFailure(error, root, logFile) {
498
511
  };
499
512
  }
500
513
  async function runAndroid(options = {}) {
514
+ const { context } = options;
501
515
  let { root, json, commandRemoteBackend, resolveSettingsFor, resolveRemoteDeviceContext, makeRemoteDeviceDeps, resolveEasBin, ensureRemoteMetro, ensureRemoteOwned, detectRemoteProviders, metroCheck, useBuildCache: requestedBuildCache, easProfile, resolveEasBuild, variantFlag, systemImageFlag, deviceProfileFlag, deviceFlag, waitFlag, waitConflict, acquireLease, makeRunLease, selectPool, onLeaseSignal, listDevices, deviceModel, deviceAbi, isEmulatorDevice, readApkPackage, getLimits, checkCapacity, acquireSlot, releaseSlot, ensureDevice, listSystemImages, listDeviceProfiles, ensureDeviceBooted, resolveAvdSerial, waitForDeviceBoot, dataFreeBytes, trimCaches, wipeDevice, resolveMetro, prewarmMetro, startServer, readState, pidAlive, verifyCollector, verifyLaunched, ensureStorage, acquireLock, releaseLock, waitForBuild, easAuth, resolveRemoteBuild, uploadRemoteBuild, resolveCacheProvider, loadCacheProviderModule, install, launch, launchRelease, verifyReleaseLaunched, resolveDevClientScheme, spawn, kill, createWriter, writeLaunch, writeState, recordBuild, recordStats, recordCapacityRefusal: recordRefusal = recordCapacityRefusal, readEstimates, now, out, emit } = androidSlotOptions(options);
502
516
  const progress = options.progress ?? NO_BUILD_PROGRESS;
503
517
  const slot = validateDeviceSlot(options.slot);
@@ -553,7 +567,7 @@ async function runAndroid(options = {}) {
553
567
  slot
554
568
  }
555
569
  }), progress);
556
- setRemoteLogSink((entry) => writer.write(entry));
570
+ setRemoteLogSink(context, (entry) => writer.write(entry));
557
571
  const record = {
558
572
  fingerprint: null,
559
573
  cacheKey: null,
@@ -575,8 +589,8 @@ async function runAndroid(options = {}) {
575
589
  const recordRun = stats.record;
576
590
  let ccacheActivity = CCACHE_NOT_RUN;
577
591
  let reclaimed = [];
578
- const fail = (code, message, remedy, { lastBuildStatus = false, setup = false, diagnostics = [], buildDiagnostics: rawDiagnostics = [], lines = [], logPath = null, lease } = {}) => {
579
- const cancellation = cancelledFailure(PLATFORM, {
592
+ const fail = (code, message, remedy, { lastBuildStatus = false, setup = false, diagnostics = [], buildDiagnostics: rawDiagnostics = [], retainedClaimRoots, lines = [], logPath = null, lease } = {}) => {
593
+ const cancellation = cancelledFailure(context, PLATFORM, {
580
594
  code,
581
595
  message
582
596
  });
@@ -616,12 +630,23 @@ async function runAndroid(options = {}) {
616
630
  error: {
617
631
  code,
618
632
  message,
619
- remedy: remedy ?? null
633
+ remedy: remedy ?? null,
634
+ ...retainedClaimRoots ? { retainedClaimRoots } : {}
620
635
  }
621
636
  };
622
637
  };
623
638
  const settingsRoot = root;
624
- const settingsContext = projectSettingsContext(root);
639
+ const settingsSignal = runCancellationSignal(context) ?? context.signal;
640
+ let settingsContext;
641
+ try {
642
+ settingsContext = await projectSettingsContextAsync(root, void 0, {
643
+ env: context.env,
644
+ signal: settingsSignal
645
+ });
646
+ } catch (error) {
647
+ if (!settingsSignal.aborted) throw error;
648
+ return fail("STIM_CANCELLED", "before resolving project settings", null, { setup: true });
649
+ }
625
650
  const projectKey = statsProjectKey$1({
626
651
  root,
627
652
  commonDir: settingsContext.gitCommonDir,
@@ -645,9 +670,11 @@ async function runAndroid(options = {}) {
645
670
  const { code, message, remedy } = placement.failure;
646
671
  return fail(code, message, remedy, { setup: true });
647
672
  }
648
- const planned = resolveAndroidRunPlan({
673
+ const planned = await resolveAndroidRunPlan({
649
674
  settings,
650
675
  settingsContext,
676
+ env: context.env,
677
+ signal: context.signal,
651
678
  slot,
652
679
  easProfile,
653
680
  variant: variantFlag,
@@ -673,7 +700,7 @@ async function runAndroid(options = {}) {
673
700
  if (easProfile !== void 0 && !integration.eas) return fail("STIM_BAD_ARG", "This project integration does not support EAS builds.", "Use its local Android build recipe.");
674
701
  const deviceSlotWait = {
675
702
  automatic: plan.target.kind === "hosted" && plan.target.machine === "auto",
676
- signal: runCancellationSignal(),
703
+ signal: runCancellationSignal(context),
677
704
  waitMs: plan.deviceSlotWaitMs,
678
705
  displayName: basename(root),
679
706
  reclaimIdleMinutes: deviceReclaimIdleMinutesSetting(settings),
@@ -704,6 +731,8 @@ async function runAndroid(options = {}) {
704
731
  ...integration.eas && remoteEasFallbackSetting(settings) ? { eas: () => (options.checkEasFallback ?? checkEasFallback)({
705
732
  root,
706
733
  platform: PLATFORM,
734
+ env: context.env,
735
+ operation: context,
707
736
  slot,
708
737
  release,
709
738
  isExpo,
@@ -713,6 +742,7 @@ async function runAndroid(options = {}) {
713
742
  }) } : {},
714
743
  localSelectors: (target) => androidDeviceSelectorRefusal({
715
744
  settingsContext,
745
+ signal: context.signal,
716
746
  slot,
717
747
  systemImageFlag,
718
748
  deviceProfileFlag,
@@ -724,7 +754,10 @@ async function runAndroid(options = {}) {
724
754
  listSystemImages,
725
755
  listDeviceProfiles
726
756
  }),
727
- checkBudget: options.checkBudget,
757
+ checkBudget: (args) => (options.checkBudget ?? budgetGate)({
758
+ ...args,
759
+ env: context.env
760
+ }),
728
761
  note: out,
729
762
  phase,
730
763
  log: (entry) => writer.write(entry),
@@ -746,10 +779,13 @@ async function runAndroid(options = {}) {
746
779
  root,
747
780
  platform: PLATFORM,
748
781
  backend: remoteBackend,
782
+ env: context.env,
783
+ operation: context,
749
784
  easBin: resolveEasBin(root)?.file ?? null
750
785
  }) : null;
751
786
  if (remoteContext && "failed" in remoteContext) return fail(remoteContext.code ?? "STIM_NO_REMOTE_SESSION", remoteContext.failed, remoteContext.remedy);
752
787
  const easBuild = await resolveEasBuild({
788
+ context,
753
789
  root,
754
790
  platform: PLATFORM,
755
791
  profile: easProfile,
@@ -757,10 +793,22 @@ async function runAndroid(options = {}) {
757
793
  isExpo,
758
794
  physical,
759
795
  selectors: [variantFlag],
760
- buildCache: requestedBuildCache
796
+ buildCache: requestedBuildCache,
797
+ env: context.env,
798
+ signal: settingsSignal
799
+ }).catch((error) => {
800
+ const cancelled = cancelledFailure(context, PLATFORM, {
801
+ code: "STIM_CANCELLED",
802
+ message: "during EAS lookup"
803
+ });
804
+ if (cancelled) return {
805
+ ok: false,
806
+ ...cancelled
807
+ };
808
+ throw error;
761
809
  });
762
810
  if (isEasBuildFailure(easBuild)) return fail(easBuild.code, easBuild.message, easBuild.remedy);
763
- const appIds = integration.appIds();
811
+ const appIds = await integration.appIds();
764
812
  let androidPackage = appIds.androidPackage;
765
813
  record.bundleId = androidPackage;
766
814
  const registerProject = () => upsertProject(root, {
@@ -778,6 +826,7 @@ async function runAndroid(options = {}) {
778
826
  async function prepareMetro() {
779
827
  if (metroCheck) {
780
828
  const gate = await ensureDevServer({
829
+ env: context.env,
781
830
  root,
782
831
  port: reservedPort,
783
832
  settings: hostedMetroSettings(settings, Boolean(hostedTarget)),
@@ -795,7 +844,8 @@ async function runAndroid(options = {}) {
795
844
  code: gate.code,
796
845
  message: gate.message,
797
846
  remedy: gate.remedy,
798
- lines: gate.lines
847
+ lines: gate.lines,
848
+ ...gate.retainedClaimRoots ? { retainedClaimRoots: gate.retainedClaimRoots } : {}
799
849
  }
800
850
  };
801
851
  metroPort = gate.port;
@@ -806,7 +856,7 @@ async function runAndroid(options = {}) {
806
856
  prepared: { metroPort }
807
857
  };
808
858
  } else {
809
- const pin = metroPortSetting(settings);
859
+ const pin = metroPortSetting(settings, context.env);
810
860
  if (pin.error) return {
811
861
  ok: false,
812
862
  error: {
@@ -831,8 +881,11 @@ async function runAndroid(options = {}) {
831
881
  const useBuildCache = buildPlan.cache.read;
832
882
  const preparation = await runtime.prepare();
833
883
  if (!preparation.ok) {
834
- const { code, message, remedy, lines } = preparation.error;
835
- return fail(code, message, remedy, { lines });
884
+ const { code, message, remedy, lines, retainedClaimRoots } = preparation.error;
885
+ return fail(code, message, remedy, {
886
+ lines,
887
+ retainedClaimRoots
888
+ });
836
889
  }
837
890
  const runtimePreparation = preparation.prepared;
838
891
  metroPort = runtimePreparation.metroPort;
@@ -841,6 +894,7 @@ async function runAndroid(options = {}) {
841
894
  if (metroPort !== null) {
842
895
  const reachable = await ensureRemoteMetro({
843
896
  ctx: remoteDevice.ctx,
897
+ env: context.env,
844
898
  metroPort,
845
899
  isExpo,
846
900
  tunnelMode: tunnelModeSetting(settings) ?? void 0,
@@ -852,8 +906,9 @@ async function runAndroid(options = {}) {
852
906
  checkCapacity = remoteDevice.checkCapacity;
853
907
  ensureDevice = remoteDevice.ensureDevice;
854
908
  ensureDeviceBooted = remoteDevice.ensureDeviceBooted;
855
- install = remoteDevice.install;
856
- launch = remoteDevice.launch;
909
+ const remote = remoteDevice;
910
+ install = async (args) => remote.install(args);
911
+ launch = async (args) => remote.launch(args);
857
912
  }
858
913
  const emuLog = emulatorLogFile(root);
859
914
  const limits = getLimits();
@@ -901,7 +956,7 @@ async function runAndroid(options = {}) {
901
956
  });
902
957
  } else {
903
958
  if (!remoteDevice) try {
904
- configuredAndroidEmulatorApp();
959
+ await configuredAndroidEmulatorApp();
905
960
  } catch (err) {
906
961
  return fail("STIM_BAD_ARG", err.message, "Run `stim settings set androidEmulatorApp emulator` or `stim settings set androidEmulatorApp stim-desktop`.");
907
962
  }
@@ -962,6 +1017,7 @@ async function runAndroid(options = {}) {
962
1017
  root,
963
1018
  platform: PLATFORM,
964
1019
  sessionName: ownedSessionName(remoteDevice.ctx.label),
1020
+ operation: context,
965
1021
  startedAt: new Date(now()).toISOString(),
966
1022
  boot,
967
1023
  createdSessionId: remoteDevice.createdSessionId,
@@ -993,10 +1049,12 @@ async function runAndroid(options = {}) {
993
1049
  bundleUrl: metroWarmupUrlSetting(settings, "android")
994
1050
  });
995
1051
  const acquiredArtifact = await acquireAndroidArtifact({
1052
+ context,
996
1053
  root,
997
1054
  buildLog,
998
1055
  writer,
999
1056
  recipe: integration.artifact({
1057
+ operation: context,
1000
1058
  root,
1001
1059
  buildLog,
1002
1060
  writer,
@@ -1058,7 +1116,7 @@ async function runAndroid(options = {}) {
1058
1116
  ccacheActivity = artifact.ccache;
1059
1117
  androidPackage = artifact.androidPackage;
1060
1118
  record.appPath = apkPath;
1061
- if (runCancellation()) return fail("STIM_CANCELLED", "before install");
1119
+ if (runCancellation(context)) return fail("STIM_CANCELLED", "before install");
1062
1120
  if (hostedTarget) return finishHostedAndroidRun({
1063
1121
  target: hostedTarget,
1064
1122
  artifact,
@@ -1151,12 +1209,13 @@ async function runAndroid(options = {}) {
1151
1209
  expiresAt: acquired.status === "leased" ? acquired.expiresAt : null
1152
1210
  });
1153
1211
  if (acquired.status === "leased") {
1154
- stopLeaseSignals = onLeaseSignal(releaseLease);
1212
+ stopLeaseSignals = onLeaseSignal(context, releaseLease);
1155
1213
  phase("lease", `${acquired.kind} lease on ${device.serial} until ${leaseExpiryText(acquired.expiresAt, now())}`);
1156
1214
  }
1157
1215
  }
1158
1216
  try {
1159
1217
  return await finishAndroidRun({
1218
+ operation: context,
1160
1219
  runtime,
1161
1220
  runtimePreparation,
1162
1221
  slot,
@@ -1200,7 +1259,7 @@ async function runAndroid(options = {}) {
1200
1259
  phase,
1201
1260
  fail,
1202
1261
  readApkPackage,
1203
- readProjectPackage: () => integration.appIds().androidPackage,
1262
+ readProjectPackage: async () => (await integration.appIds()).androidPackage,
1204
1263
  packageRemedy: integration.packageRemedy,
1205
1264
  install,
1206
1265
  launch,
@@ -1244,14 +1303,19 @@ async function runAndroid(options = {}) {
1244
1303
  try {
1245
1304
  return await runFromFingerprint();
1246
1305
  } catch (error) {
1306
+ const cancelled = cancelledFailure(context, PLATFORM, {
1307
+ code: "STIM_CANCELLED",
1308
+ message: "while finishing the run"
1309
+ });
1310
+ if (cancelled) return fail(cancelled.code, cancelled.message, cancelled.remedy, { lastBuildStatus: true });
1247
1311
  recordRun({
1248
1312
  failed: true,
1249
1313
  durationMs: now() - started
1250
1314
  });
1251
1315
  throw error;
1252
1316
  } finally {
1253
- preparedArtifact?.release();
1317
+ await preparedArtifact?.release();
1254
1318
  }
1255
1319
  }
1256
1320
  //#endregion
1257
- export { runAndroidOperation as i, registerAndroid as n, runAndroid as r, androidCommand as t };
1321
+ export { readAndroidBuildPlan as a, runAndroidOperation as i, registerAndroid as n, runAndroid as r, androidCommand as t };