stim 1.20.1 → 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 +94 -11
  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-VPaOgGaF.mjs → agent-device-usage-output-zh1vhbLp.mjs} +21 -66
  6. package/dist/{android-CZh6ElG5.mjs → android-BEJ8Jpl7.mjs} +3 -3
  7. package/dist/{android-CLbBJ2ve.mjs → android-BLgbNqox.mjs} +128 -79
  8. package/dist/{android-eXfIjKJr.mjs → android-CV_GCELZ.mjs} +5 -5
  9. package/dist/{android-DE8-JfGW.mjs → android-DUYkNF4u.mjs} +188 -106
  10. package/dist/{android-cas-BFpS84v2.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-Ctb2jpw6.mjs → artifact-B8T3S5gi.mjs} +223 -201
  16. package/dist/{artifact-DXk_Fle_.mjs → artifact-DAuZ-FNU.mjs} +158 -148
  17. package/dist/{browser-web-xQWC2RWl.mjs → browser-web-QQzVjz3O.mjs} +28 -26
  18. package/dist/budget-Bs6SxxzO.mjs +9154 -0
  19. package/dist/{build-COBA1tBc.mjs → build-CoPzQRNw.mjs} +144 -101
  20. package/dist/build-cache-DmyR9Zzc.mjs +602 -0
  21. package/dist/build-plan-CaFskB7_.mjs +188 -0
  22. package/dist/{cache-manifest-qA3dT2x2.mjs → cache-manifest-DkkqguoK.mjs} +10 -5
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/{ccache-CtbqWxIC.mjs → ccache-BJRZ9pG3.mjs} +10 -9
  25. package/dist/{cdp-Dq_ypAlJ.mjs → cdp-CWmIUMbw.mjs} +18 -5
  26. package/dist/{chrome-Dp2lMLBe.mjs → chrome-B6tfCta1.mjs} +7 -4
  27. package/dist/{cli-sGqlPu1n.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 -39
  32. package/dist/collector-run.mjs +9 -9
  33. package/dist/{command-output-CPDq_90S.mjs → command-output-B1UrjZHL.mjs} +1 -1
  34. package/dist/config-CYcBF478.mjs +949 -0
  35. package/dist/{created-devices-CXBMtoj5.mjs → created-devices-CqeBlrEn.mjs} +3 -3
  36. package/dist/{dependency-state-B2m8eqsS.mjs → dependency-state-BbKQW83h.mjs} +20 -5
  37. package/dist/{detached-entry-BXq4fIl-.mjs → detached-entry-DFRyG1_o.mjs} +1 -1
  38. package/dist/{dev-client-BqYjMIaC.mjs → dev-client-UOeESKm6.mjs} +2 -2
  39. package/dist/device-DCxH7_By.mjs +1068 -0
  40. package/dist/{device-D4DqjSZZ.mjs → device-ExJq8Ei7.mjs} +35 -36
  41. package/dist/{device-capacity-DrwHwR97.mjs → device-capacity-CMlqEcvw.mjs} +43 -14
  42. package/dist/device-host-worker.mjs +65 -62
  43. package/dist/{device-ios-DE8KJd3b.mjs → device-ios-DRUeKaFV.mjs} +49 -49
  44. package/dist/{device-lease-run-Baelt3nc.mjs → device-lease-run-C8raGFoP.mjs} +14 -26
  45. package/dist/{device-pool-DtK9S6AD.mjs → device-pool-DMRpVX9a.mjs} +5 -5
  46. package/dist/doctor-BLHCYxzi.mjs +2 -0
  47. package/dist/{doctor-Dunu3Nv1.mjs → doctor-DTvaDOda.mjs} +317 -344
  48. package/dist/{doctor-DiP9HsIP.mjs → doctor-Dhqebm0q.mjs} +183 -91
  49. package/dist/doctor-fingerprint.mjs +19 -0
  50. package/dist/{doctor-watchman-XJzT8tK-.mjs → doctor-watchman-Cv1F10Kj.mjs} +40 -23
  51. package/dist/{eas-build-0gadvrca.mjs → eas-build-BomfRnFT.mjs} +53 -20
  52. package/dist/{build-plan-CRjAA6Qi.mjs → eas-fallback-DJwZpy0c.mjs} +26 -208
  53. package/dist/{watchman-CqmaGcIb.mjs → eas-session-ledger-op6A54yi.mjs} +229 -11
  54. package/dist/{error-diagnostics-BhQtoLrZ.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-D5cz5G0k.mjs → gc-_-dCXdyL.mjs} +625 -786
  59. package/dist/git-C3iTsJaZ.mjs +73 -0
  60. package/dist/{guide-DakjcoUt.mjs → guide-Yqwt2bd6.mjs} +990 -280
  61. package/dist/{hosted-android-C-D8Dj0_.mjs → hosted-android-Bw-honsd.mjs} +8 -6
  62. package/dist/{hosted-client--hNFgixu.mjs → hosted-client-DB_gBPfY.mjs} +47 -24
  63. package/dist/{hosted-ios-Chx9XQyI.mjs → hosted-ios-CUvOf4Vr.mjs} +1 -1
  64. package/dist/{hosted-logs-Bkz0Hxzh.mjs → hosted-logs-DL_P5AdN.mjs} +77 -43
  65. package/dist/{hosted-macos-ckTjN-0V.mjs → hosted-macos-QI141yKk.mjs} +21 -15
  66. package/dist/{hosted-native-3KXZ5-qn.mjs → hosted-native-Ksyjgzq-.mjs} +31 -20
  67. package/dist/idle-BVeRGroT.d.mts +24 -0
  68. package/dist/{idle-shutdown-DhAUyf5s.mjs → idle-shutdown-DaKmZi0z.mjs} +11 -10
  69. package/dist/{ios-BDBN-xpf.mjs → ios-CQ68hG9s.mjs} +8 -8
  70. package/dist/{ios-o896T9PE.mjs → ios-CpByZy12.mjs} +141 -81
  71. package/dist/{ios-device-B1B14xND.mjs → ios-device-CXGP1bsD.mjs} +1 -1
  72. package/dist/{ios-device-BWHKGaJq.mjs → ios-device-CwFMehUS.mjs} +60 -35
  73. package/dist/{ios-project-BeOXKPt2.mjs → ios-project-WuwwBdvW.mjs} +13 -13
  74. package/dist/{ios-VGvNdsv2.mjs → ios-qNJt4dFm.mjs} +1 -1
  75. package/dist/ios-signing-DTTIChGs.mjs +489 -0
  76. package/dist/{ios-state-BsXMwo5y.mjs → ios-state-DvFX-K_l.mjs} +1 -1
  77. package/dist/{ios-CQ8bHQXB.mjs → ios-ubFsBzwq.mjs} +129 -86
  78. package/dist/{js-swap-Z_mSuRrx.mjs → js-swap-Cc1dttps.mjs} +60 -33
  79. package/dist/{launch-V1zqiOYn.mjs → launch-CD1yVc7U.mjs} +92 -91
  80. package/dist/{launch-BootbMk4.mjs → launch-Zq2mOSDy.mjs} +87 -545
  81. package/dist/logs-BS00Anxf.mjs +352 -0
  82. package/dist/logs-CMm05HxN.mjs +255 -0
  83. package/dist/macos-B65--pPd.mjs +2 -0
  84. package/dist/{macos-D7irBW3A.mjs → macos-C-0qJ6zq.mjs} +244 -215
  85. package/dist/macos-run.mjs +1 -1
  86. package/dist/maintenance-run.mjs +122 -247
  87. package/dist/{metro-_ZIE3Axg.mjs → metro-DEXpIhHC.mjs} +71 -17
  88. package/dist/{metro-gateway-BzlQZQmU.mjs → metro-gateway-BMJNlj3E.mjs} +20 -12
  89. package/dist/{named-ports-O1TIl7tx.mjs → named-ports-BWTzt6mu.mjs} +8 -64
  90. package/dist/native-android-JACyjTZs.mjs +844 -0
  91. package/dist/{native-gradle-inputs-BQnIdAlL.mjs → native-gradle-inputs-Bep9JcSF.mjs} +128 -147
  92. package/dist/native-inputs-TRTTTRxt.mjs +91 -0
  93. package/dist/native-run-DY_RLx3C.mjs +277 -0
  94. package/dist/{native-runtime-D024BAvm.mjs → native-runtime-Dg1Q7tfF.mjs} +10 -10
  95. package/dist/{native-xcode-inputs-UElfGs59.mjs → native-xcode-inputs-CB2iQeWq.mjs} +28 -20
  96. package/dist/{native-xcode-ios-CjS-nDVY.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 +213 -86
  100. package/dist/{ownership-BrjepDiv.mjs → ownership-DEmM5vhh.mjs} +3 -3
  101. package/dist/{page-Bv9s2KwY.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-BItXET1x.mjs → placement-log-BqGbTa61.mjs} +5 -5
  105. package/dist/{plan-placement-B466UYMU.mjs → plan-placement-Bwj-IjY1.mjs} +6 -6
  106. package/dist/{ports-BFRL6JTj.mjs → ports-D-MmCTdv.mjs} +3 -3
  107. package/dist/prebuild-uD_ipCxF.mjs +449 -0
  108. package/dist/{project-DX8fXyw_.mjs → project-BZNjmW_8.mjs} +65 -38
  109. package/dist/{pull-request-vOhLNmIb.mjs → pull-request-Lfetn8Kr.mjs} +5 -18
  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-CuXM3QS8.mjs → react-native-android-DuzH0cn3.mjs} +83 -53
  114. package/dist/{gradle-CZZo1TSA.mjs → react-native-build-rhk4smwQ.mjs} +292 -15
  115. package/dist/react-native-doctor-CQpuIMso.mjs +234 -0
  116. package/dist/{react-native-ios-DtVO4qf2.mjs → react-native-ios-Bhq1rJeV.mjs} +46 -28
  117. package/dist/{recordings-Bk-VivUV.mjs → recordings-DYteQSu4.mjs} +12 -9
  118. package/dist/{reload-D9V7D8gP.mjs → reload-CmTRFJaX.mjs} +95 -49
  119. package/dist/reload-DzjSl5P_.mjs +2 -0
  120. package/dist/{remote-CZiTijxG.mjs → remote-ByYkXdGD.mjs} +15 -10
  121. package/dist/result-DNiS-tTP.mjs +434 -0
  122. package/dist/{run-ClC8UVB5.mjs → run-D23HmJMs.mjs} +4 -5
  123. package/dist/selection-CSl9i5qU.mjs +619 -0
  124. package/dist/{server-bare-dWjAarki.mjs → server-bare-CxTrvDg8.mjs} +3 -4
  125. package/dist/{server-command-DnJYLnr4.mjs → server-command-CtzloH3v.mjs} +14 -7
  126. package/dist/server-expo-C-90EhcG.mjs +2 -0
  127. package/dist/{server-expo-CUuzP9Mp.mjs → server-expo-DT_F_uVI.mjs} +51 -15
  128. package/dist/{settings-Bbztm4oV.mjs → settings-CsJDEXgK.mjs} +301 -132
  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-ChMfe8rg.mjs → simslim-Cgk17SXV.mjs} +14 -13
  134. package/dist/{slot-launch-CeCRr6MK.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-CRkG-mZ7.mjs → start-7lpH7hmN.mjs} +66 -48
  138. package/dist/{start-mh6bS27z.mjs → start-RChynRDp.mjs} +1 -1
  139. package/dist/{state-lqxdOH_g.mjs → state-C4ZtUisW.mjs} +41 -14
  140. package/dist/{state-BUpAmt2r.mjs → state-XMziexv2.mjs} +3 -2
  141. package/dist/{stats-CaB1MxMi.mjs → stats-53T7OTb9.mjs} +7 -13
  142. package/dist/stats-report-BFfMpWWF.mjs +16 -0
  143. package/dist/{status-C7vzkInu.mjs → status-BL7jVyAB.mjs} +538 -467
  144. package/dist/status-CSi6tlRq.mjs +2 -0
  145. package/dist/{status-BDGHwkCs.mjs → status-DqEUSSxs.mjs} +6 -4
  146. package/dist/{status-watch-ZaVqRdtW.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-BU7JaFCg.mjs → stop-Bk_1qiV6.mjs} +2 -2
  151. package/dist/{stop-BO80KJoT.mjs → stop-CPzlM1L-.mjs} +138 -99
  152. package/dist/{stop-Cftw_sXJ.mjs → stop-D7h6jAXQ.mjs} +11 -10
  153. package/dist/supervisor-run.d.mts +8 -17
  154. package/dist/supervisor-run.mjs +63 -28
  155. package/dist/{support-Ca6PZbpr.mjs → support-67vraa1Q.mjs} +18 -11
  156. package/dist/{support-Co0wk8Cv.mjs → support-Dlu37g6H.mjs} +12 -12
  157. package/dist/{swiftpm-macos-siFSkmCO.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-C0MWBi8O.mjs → trigger-BAahxUPq.mjs} +20 -5
  161. package/dist/trigger-Bf3uDcpv.mjs +2 -0
  162. package/dist/{warm-progress-5FAXkXIg.mjs → warm-progress-BHX5r0Ei.mjs} +252 -176
  163. package/dist/{web-BTjzE8mc.mjs → web-CJmIj6AI.mjs} +18 -13
  164. package/dist/web-DknQETPs.mjs +2 -0
  165. package/dist/web-run.mjs +16 -17
  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-CvgTFe-h.mjs → workspace-state-Cjuigeeu.mjs} +70 -56
  171. package/dist/{workspaces-C4kqIOlx.mjs → workspaces-BccMFmGQ.mjs} +1188 -1080
  172. package/dist/worktree-CK2MpJW5.mjs +2 -0
  173. package/dist/{worktree-DtRsh6go.mjs → worktree-DQ6Zi2Mv.mjs} +368 -110
  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-BaMpUQ4-.mjs +0 -629
  178. package/dist/api-run.mjs +0 -296
  179. package/dist/api-zuX3ynYN.mjs +0 -154
  180. package/dist/app-install-Cg9YJy3x.mjs +0 -873
  181. package/dist/artifact-lifecycle-DzPpBYvK.mjs +0 -30
  182. package/dist/budget-RFbwFpG5.mjs +0 -4109
  183. package/dist/build-facts-DcLv2HSd.d.mts +0 -111
  184. package/dist/client-zqjFd79D.mjs +0 -1779
  185. package/dist/config-D0LhTY3S.mjs +0 -524
  186. package/dist/device-BgNj-qVj.mjs +0 -290
  187. package/dist/device-lease-C309csaB.mjs +0 -1228
  188. package/dist/device-remote-DjsNw8DD.mjs +0 -1272
  189. package/dist/eas-session-ledger-DJDeL4Uq.mjs +0 -205
  190. package/dist/exec-B81Qodjn.mjs +0 -254
  191. package/dist/launch-verify-Dl78EVgR.mjs +0 -428
  192. package/dist/logs-Bh4eqCCc.mjs +0 -384
  193. package/dist/macos-kivF8qKz.mjs +0 -2
  194. package/dist/miss-reason-SuTptY-I.mjs +0 -238
  195. package/dist/native-android-D94RlJ-X.mjs +0 -226
  196. package/dist/ndjson-Du3j0AQ9.d.mts +0 -17
  197. package/dist/plan-Jwu_vr-F.mjs +0 -260
  198. package/dist/prebuild-DB_zLOLc.mjs +0 -213
  199. package/dist/preview-BRLFRhTz.mjs +0 -1004
  200. package/dist/process-identity-Biv3arCO.mjs +0 -40
  201. package/dist/react-native-build-JUF31S8U.mjs +0 -239
  202. package/dist/react-native-doctor-BQHqiXaQ.mjs +0 -78
  203. package/dist/remote-cache-fxcl5C-L.mjs +0 -526
  204. package/dist/result-BrfgXtdO.mjs +0 -186
  205. package/dist/server-expo-Dvkd7JcF.mjs +0 -2
  206. package/dist/settings-BuKMOANA.mjs +0 -402
  207. package/dist/spawn-claims-Kqiifsk2.mjs +0 -72
  208. package/dist/stage-BNKKdDNc.mjs +0 -157
  209. package/dist/stim-desktop-8GQX2OV8.mjs +0 -63
  210. package/dist/tailnet-D7-tE_ug.mjs +0 -265
  211. package/dist/toolchain-B12psPA2.mjs +0 -2
  212. package/dist/toolchain-SqehyPLw.mjs +0 -1657
  213. package/dist/trigger-SHLOWJ4O.mjs +0 -2
  214. package/dist/web-CHN5gh34.mjs +0 -2
  215. package/dist/worktree-Cgnm6vZt.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,51 +1,48 @@
1
- import { n as ownership_claim_exports } from "./process-identity-Biv3arCO.mjs";
2
- import { t as getExecutor } from "./exec-B81Qodjn.mjs";
3
- import { E as upsertProject, L as deviceSlotFileKey, V as parseDeviceSlotOption, W as validateDeviceSlot, p as getProject, u as getConcurrencyLimits, z as deviceSlotPlatforms } from "./config-D0LhTY3S.mjs";
4
- import { I as projectSettingsContext, K as resolveProjectSettings, L as publicUrlSetting, N as metroWarmupUrlSetting, V as remoteEasFallbackSetting, W as resolveCacheProviderConfig, a as SETTING_SHAPE_REMEDY, at as detectProviders, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, q as resolveSettings, tt as tunnelModeSetting } from "./settings-Bbztm4oV.mjs";
5
- import { _ as waitForBuild, g as releaseBuildLock, m as acquireBuildLock } from "./device-lease-C309csaB.mjs";
6
- import { c as writeWorkspaceState, f as emulatorLogFile, i as recordWorkspaceUse, r as readWorkspaceState$1, w as workspaceLogsDir$1 } from "./workspace-state-CvgTFe-h.mjs";
7
- import { _ as stepTimer, f as refuseNoProject, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-CPDq_90S.mjs";
8
- import { I as workspaceDevServerMode, R as writeWorkspaceLaunch, c as projectShortcut, d as projectRegistry, r as findProjectRoot, t as NO_PROJECT_REFUSAL } from "./project-DX8fXyw_.mjs";
9
- 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-DE8-JfGW.mjs";
10
- import { s as pidExists, u as resolveProjectMetro } from "./metro-_ZIE3Axg.mjs";
11
- import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-C4kqIOlx.mjs";
12
- 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-RFbwFpG5.mjs";
13
- import { S as withNativeBuildRun, b as runCancellation, p as cancelledFailure, x as runCancellationSignal } from "./tailnet-D7-tE_ug.mjs";
14
- import { r as createNdjsonWriter } from "./ndjson-GOnbyvso.mjs";
15
- import { f as resolveEasCliBin, i as checkEasAuth, m as uploadRemote, p as resolveRemote } from "./remote-cache-fxcl5C-L.mjs";
16
- import { f as setRemoteLogSink, g as parseBuildMachineOption, y as resolveBuildPlacement } from "./client-zqjFd79D.mjs";
17
- import { c as startDevServer } from "./start-CRkG-mZ7.mjs";
18
- import { d as verifyAndroidReleaseLaunch, f as verifyLaunch } from "./launch-verify-Dl78EVgR.mjs";
19
- import { b as launchAndroidReleaseApp, h as installAndroidApp, r as DEFAULT_METRO_PORT, t as ADB_INSTALL_TIMEOUT_MS, y as launchAndroidApp } from "./app-install-Cg9YJy3x.mjs";
20
- import { n as ensureWorkspaceStorageSafely, r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-D024BAvm.mjs";
21
- import { n as devicePlacementRecord } from "./placement-log-BItXET1x.mjs";
22
- import { t as CCACHE_NOT_RUN } from "./ccache-CtbqWxIC.mjs";
23
- import { n as DeviceAdmissionRefusal, r as checkDeviceCapacity } from "./device-capacity-DrwHwR97.mjs";
24
- 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-Ca6PZbpr.mjs";
25
- import { r as resolveAndroidRunPlan, t as androidDeviceSelectorRefusal } from "./plan-Jwu_vr-F.mjs";
26
- import { t as acquireAndroidArtifact } from "./artifact-DXk_Fle_.mjs";
27
- import { a as acquireRunLease, d as runLease, f as waitFlagConflict, o as leaseExpiryText, u as releaseLeaseOnSignal } from "./device-lease-run-Baelt3nc.mjs";
28
- import { a as reportAndroidResult, i as persistLastBuild, n as finishAndroidUpload } from "./result-BrfgXtdO.mjs";
29
- import { r as hostedMetroSettings } from "./metro-gateway-BzlQZQmU.mjs";
30
- import { a as writeHostedAndroid, i as writeDevicePlacement, t as readHostedAndroid } from "./ios-state-BsXMwo5y.mjs";
31
- import { a as refusePlan, c as devicePlacementLine, i as printPlan, n as planFlagRefusal, o as checkEasFallback, s as automaticDevicePlacement } from "./build-plan-CRjAA6Qi.mjs";
32
- import { n as prepareHostedAndroid, t as placeHostedAndroid } from "./hosted-android-C-D8Dj0_.mjs";
33
- import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CeCRr6MK.mjs";
34
- import { S as ownedSessionName, a as ensureMetroReachable, c as remoteAndroidDeps, n as binOnPath, o as ensureRemoteBootOwned, u as resolveRemoteContext } from "./device-remote-DjsNw8DD.mjs";
35
- import { a as resolveEasDevelopmentBuild, r as isEasBuildFailure } from "./eas-build-0gadvrca.mjs";
36
- import { n as verifyCollectorOwnership } from "./ownership-BrjepDiv.mjs";
37
- import { a as AvdRecoveryError, i as AvdBootError, n as ensureBooted, o as warmMetro, r as ensureOwnedDevice, t as didSetUpDevice } from "./device-D4DqjSZZ.mjs";
38
- import { t as selectFromPool } from "./device-pool-DtK9S6AD.mjs";
39
- import { r as finishAndroidRun } from "./launch-V1zqiOYn.mjs";
1
+ import { f as ownership_claim_exports, t as getExecutor } from "./exec-_UbtCQcG.mjs";
2
+ import { m as workspaceLogsDir$1, t as emulatorLogFile } from "./paths-DQtTgsBf.mjs";
3
+ import { E as upsertProject, G as parseDeviceSlotOption, J as validateDeviceSlot, U as deviceSlotPlatforms, V as deviceSlotFileKey, p as getProject, u as getConcurrencyLimits } from "./config-CYcBF478.mjs";
4
+ import { _ as stepTimer, f as refuseNoProject, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-B1UrjZHL.mjs";
5
+ import { d as writeWorkspaceState, i as recordWorkspaceUse, r as readWorkspaceState$1 } from "./workspace-state-Cjuigeeu.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-CsJDEXgK.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-BZNjmW_8.mjs";
8
+ import { r as createNdjsonWriter } from "./ndjson-CgE_o3Dl.mjs";
9
+ import { f as resolveProjectMetro, l as pidExists } from "./metro-DEXpIhHC.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-Bs6SxxzO.mjs";
11
+ import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-DY_RLx3C.mjs";
12
+ import { F as acquireBuildSlot, L as releaseBuildSlot } from "./workspaces-BccMFmGQ.mjs";
13
+ import { F as waitForBuild, M as acquireBuildLock, P as releaseBuildLock } from "./activity-BzVfHSrY.mjs";
14
+ import { $ as resolvePhysicalDevice, P as listInstalledSystemImages, Q as resolveOwnedAvdSerialAsync, Y as probeEmulatorSerial, a as androidDeviceAbi, it as waitForBoot, k as listAdbDevices, ot as configuredAndroidEmulatorApp, q as physicalDeviceModel } from "./android-DUYkNF4u.mjs";
15
+ import { t as CCACHE_NOT_RUN } from "./ccache-BJRZ9pG3.mjs";
16
+ import { f as setRemoteLogSink } from "./client-UXD70ZbM.mjs";
17
+ import { i as parseBuildMachineOption, s as resolveBuildPlacement } from "./selection-CSl9i5qU.mjs";
18
+ import { r as hostedMetroSettings } from "./metro-gateway-BMJNlj3E.mjs";
19
+ import { a as writeHostedAndroid, i as writeDevicePlacement, t as readHostedAndroid } from "./ios-state-DvFX-K_l.mjs";
20
+ import { n as prepareHostedAndroid, t as placeHostedAndroid } from "./hosted-android-Bw-honsd.mjs";
21
+ import { n as verifyCollectorOwnership } from "./ownership-DEmM5vhh.mjs";
22
+ import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DF8VfT64.mjs";
23
+ import { a as acquireRunLease, d as runLease, f as waitFlagConflict, o as leaseExpiryText, u as releaseLeaseOnAbort } from "./device-lease-run-C8raGFoP.mjs";
24
+ import { n as DeviceAdmissionRefusal, r as checkDeviceCapacity } from "./device-capacity-CMlqEcvw.mjs";
25
+ import { a as resolveEasDevelopmentBuild, r as isEasBuildFailure } from "./eas-build-BomfRnFT.mjs";
26
+ import { c as startDevServer } from "./start-7lpH7hmN.mjs";
27
+ import { n as ensureWorkspaceStorageSafely, r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-Dg1Q7tfF.mjs";
28
+ import { n as devicePlacementRecord } from "./placement-log-BqGbTa61.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-67vraa1Q.mjs";
30
+ import { t as acquireAndroidArtifact } from "./artifact-DAuZ-FNU.mjs";
31
+ import { a as reportAndroidResult, c as resolveAndroidRunPlan, i as persistLastBuild, n as finishAndroidUpload, o as androidDeviceSelectorRefusal } from "./result-DNiS-tTP.mjs";
32
+ import { n as automaticDevicePlacement, r as devicePlacementLine, t as checkEasFallback } from "./eas-fallback-DJwZpy0c.mjs";
33
+ import { a as AvdRecoveryError, i as AvdBootError, n as ensureBooted, o as warmMetro, r as ensureOwnedDevice, t as didSetUpDevice } from "./device-ExJq8Ei7.mjs";
34
+ import { t as selectFromPool } from "./device-pool-DMRpVX9a.mjs";
35
+ import { r as finishAndroidRun } from "./launch-CD1yVc7U.mjs";
40
36
  import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
37
+ import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-CaFskB7_.mjs";
41
38
  import { basename, join } from "node:path";
42
- import { hostedAndroidStatus, parseMachine } from "@stim-cli/core/state";
43
- import { loadCacheProvider } from "@stim-cli/cache";
44
39
  import { workspaceId } from "@stim-cli/core";
45
- import { InvalidArgumentError } from "commander";
40
+ import { hostedAndroidStatus, parseMachine } from "@stim-cli/core/state";
46
41
  import chalk from "chalk";
42
+ import { InvalidArgumentError } from "commander";
43
+ import { loadCacheProvider } from "@stim-cli/cache";
47
44
  //#region src/commands/android/remote.ts
48
- 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 }) {
49
46
  let recorded;
50
47
  try {
51
48
  recorded = read(root, slot)[slot];
@@ -70,12 +67,12 @@ async function connectAndroidHosting({ root, slot, machine, release, appMode = r
70
67
  if (local?.owned && local.avdName) {
71
68
  let running = true;
72
69
  try {
73
- const resolved = resolveSerial(local.avdName, { timeoutMs: 5e3 });
70
+ const resolved = await resolveSerial(local.avdName, { timeoutMs: 5e3 });
74
71
  running = Boolean(resolved.serial) || !resolved.notRunning && !resolved.missing;
75
72
  } catch {}
76
73
  if (running) return { failure: {
77
74
  code: "STIM_BAD_ARG",
78
- 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.`
79
76
  } };
80
77
  }
81
78
  try {
@@ -185,7 +182,7 @@ async function selectAndroidPlacement({ target: selected, automatic = automaticD
185
182
  //#endregion
186
183
  //#region src/commands/android/hosted.ts
187
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 }) {
188
- const packageName = artifact.androidPackage ?? readApkPackage(artifact.apkPath);
185
+ const packageName = artifact.androidPackage ?? await readApkPackage(artifact.apkPath);
189
186
  if (!artifact.apkPath || !packageName) return fail("STIM_INSTALL_FAILED", "The built APK has no package identity.");
190
187
  const launchedAt = now();
191
188
  try {
@@ -199,7 +196,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
199
196
  ...appMode === "process" ? { mode: appMode } : {},
200
197
  metroPort,
201
198
  selectors,
202
- ...appMode === "development" && isExpo ? { devClientScheme: resolveDevClientScheme(root, artifact.apkPath) ?? void 0 } : {},
199
+ ...appMode === "development" && isExpo ? { devClientScheme: await resolveDevClientScheme(root, artifact.apkPath) ?? void 0 } : {},
203
200
  reserved: (placement) => writePlacement(root, slot, placement),
204
201
  note: out,
205
202
  enterPhase
@@ -223,7 +220,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
223
220
  metroPort,
224
221
  mode: workspaceDevServerMode(root, isExpo),
225
222
  slot: launchSlotScope(root, slot),
226
- platformShared: siblingPlatformSlots(root, "android", slot).length > 0
223
+ platformShared: (await siblingPlatformSlots(root, "android", slot)).length > 0
227
224
  });
228
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.");
229
226
  launched = evidence.verified ? true : evidence.requested ? "bundling" : "unverified";
@@ -247,6 +244,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
247
244
  ok: true,
248
245
  facts: reportAndroidResult({
249
246
  ...report,
247
+ out,
250
248
  ...appMode === "process" ? { runtimeKind: "process" } : {},
251
249
  root,
252
250
  slot,
@@ -268,7 +266,7 @@ async function finishHostedAndroidRun({ target, artifact, root, slot = "default"
268
266
  })
269
267
  };
270
268
  } catch (error) {
271
- 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 });
272
270
  }
273
271
  }
274
272
  //#endregion
@@ -282,7 +280,7 @@ function runOnlyFlag(opts) {
282
280
  }
283
281
  async function planAndroid(opts, overrides = {}) {
284
282
  const deps = {
285
- findRoot: findProjectRoot,
283
+ findRoot: findProjectRoot$1,
286
284
  projectRegistry,
287
285
  ...overrides
288
286
  };
@@ -296,12 +294,13 @@ async function planAndroid(opts, overrides = {}) {
296
294
  code: "STIM_NO_PROJECT",
297
295
  ...selected.problem
298
296
  }, json);
299
- const resolved = resolveProjectSettings(root);
300
- const project = await selected.load(resolved);
301
- if (!project.plan) return refusePlan(unsupportedPlan("android"), json);
302
- const result = await project.plan(opts, resolved);
297
+ const resolved = await resolveProjectSettingsAsync(root);
298
+ const planner = (await selected.load(resolved)).plan;
299
+ if (!planner) return refusePlan(unsupportedPlan("android"), json);
300
+ const { value: result, interrupted } = await runProcessOperation(root, (operation) => planner(opts, resolved, operation));
303
301
  if ("platform" in result) printPlan(result, json);
304
302
  else refusePlan(result.refusal, json, result.lines);
303
+ if (interrupted) process.exitCode = interrupted;
305
304
  }
306
305
  //#endregion
307
306
  //#region src/commands/android.ts
@@ -309,38 +308,41 @@ function androidCommand(program) {
309
308
  registerAndroid(program);
310
309
  }
311
310
  function registerAndroid(program) {
312
- 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) => {
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 machine is full or busy; local runs here, whatever android.remote says", (value) => {
313
312
  if (!parseMachine(value)) throw new InvalidArgumentError("expected eas, proxy, auto, local, or a tailnet machine name");
314
313
  return value;
315
314
  }).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) => {
316
315
  if (opts.plan) return planAndroid(opts);
317
- const root = findProjectRoot(process.cwd());
316
+ const root = findProjectRoot$1(process.cwd());
318
317
  if (!root) {
319
318
  refuseNoProject({ json: Boolean(opts.json) });
320
319
  return;
321
320
  }
322
- if (!(await runAndroidOperation(root, {
321
+ const { value: result, interrupted } = await runProcessOperation(root, (context) => runAndroidOperation(context, root, {
323
322
  ...opts,
324
323
  waitConflict: waitFlagConflict(process.argv)
325
- })).ok) process.exit(runCancellation() ? 130 : 1);
324
+ }));
325
+ if (!result.ok) process.exit(interrupted ?? 1);
326
+ else if (result.uploadsAbandoned) exitAfterFlush(0);
326
327
  });
327
328
  }
328
- function runAndroidOperation(root, opts = {}) {
329
- return withNativeBuildRun(root, {
329
+ function runAndroidOperation(context, root, opts = {}) {
330
+ return withNativeBuildRun(context, root, {
330
331
  command: "android",
331
332
  platform: PLATFORM,
332
333
  slot: opts.slot ?? "default"
333
334
  }, async (claim) => {
334
- recordWorkspaceUse(root);
335
+ recordWorkspaceUse(root, /* @__PURE__ */ new Date(), context.env, context.cwd);
335
336
  const progress = startBuildProgress({
336
337
  root,
337
338
  platform: PLATFORM,
338
339
  slot: opts.slot ?? "default",
339
340
  claim,
340
- note: (line) => console.error(chalk.dim(line))
341
+ note: (line) => context.output("stderr", `${chalk.dim(line)}\n`)
341
342
  });
342
343
  try {
343
344
  return await runAndroid({
345
+ context,
344
346
  root,
345
347
  buildMachine: opts.remoteBuild,
346
348
  slot: opts.slot,
@@ -360,9 +362,12 @@ function runAndroidOperation(root, opts = {}) {
360
362
  } finally {
361
363
  progress.clear();
362
364
  }
363
- }, { write: (line) => console.error(chalk.dim(phaseLine("lock", line))) });
365
+ }, { write: (line) => context.output("stderr", `${chalk.dim(phaseLine("lock", line))}\n`) });
364
366
  }
365
- 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) } = {}) {
367
+ 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, {
368
+ ...options,
369
+ context
370
+ }), 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) } = {}) {
366
371
  return {
367
372
  root,
368
373
  json,
@@ -499,6 +504,7 @@ function avdSetupFailure(error, root, logFile) {
499
504
  };
500
505
  }
501
506
  async function runAndroid(options = {}) {
507
+ const { context } = options;
502
508
  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);
503
509
  const progress = options.progress ?? NO_BUILD_PROGRESS;
504
510
  const slot = validateDeviceSlot(options.slot);
@@ -554,7 +560,7 @@ async function runAndroid(options = {}) {
554
560
  slot
555
561
  }
556
562
  }), progress);
557
- setRemoteLogSink((entry) => writer.write(entry));
563
+ setRemoteLogSink(context, (entry) => writer.write(entry));
558
564
  const record = {
559
565
  fingerprint: null,
560
566
  cacheKey: null,
@@ -577,7 +583,7 @@ async function runAndroid(options = {}) {
577
583
  let ccacheActivity = CCACHE_NOT_RUN;
578
584
  let reclaimed = [];
579
585
  const fail = (code, message, remedy, { lastBuildStatus = false, setup = false, diagnostics = [], buildDiagnostics: rawDiagnostics = [], lines = [], logPath = null, lease } = {}) => {
580
- const cancellation = cancelledFailure(PLATFORM, {
586
+ const cancellation = cancelledFailure(context, PLATFORM, {
581
587
  code,
582
588
  message
583
589
  });
@@ -622,7 +628,17 @@ async function runAndroid(options = {}) {
622
628
  };
623
629
  };
624
630
  const settingsRoot = root;
625
- const settingsContext = projectSettingsContext(root);
631
+ const settingsSignal = runCancellationSignal(context) ?? context.signal;
632
+ let settingsContext;
633
+ try {
634
+ settingsContext = await projectSettingsContextAsync(root, void 0, {
635
+ env: context.env,
636
+ signal: settingsSignal
637
+ });
638
+ } catch (error) {
639
+ if (!settingsSignal.aborted) throw error;
640
+ return fail("STIM_CANCELLED", "before resolving project settings", null, { setup: true });
641
+ }
626
642
  const projectKey = statsProjectKey$1({
627
643
  root,
628
644
  commonDir: settingsContext.gitCommonDir,
@@ -649,6 +665,7 @@ async function runAndroid(options = {}) {
649
665
  const planned = resolveAndroidRunPlan({
650
666
  settings,
651
667
  settingsContext,
668
+ env: context.env,
652
669
  slot,
653
670
  easProfile,
654
671
  variant: variantFlag,
@@ -674,7 +691,7 @@ async function runAndroid(options = {}) {
674
691
  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.");
675
692
  const deviceSlotWait = {
676
693
  automatic: plan.target.kind === "hosted" && plan.target.machine === "auto",
677
- signal: runCancellationSignal(),
694
+ signal: runCancellationSignal(context),
678
695
  waitMs: plan.deviceSlotWaitMs,
679
696
  displayName: basename(root),
680
697
  reclaimIdleMinutes: deviceReclaimIdleMinutesSetting(settings),
@@ -705,6 +722,8 @@ async function runAndroid(options = {}) {
705
722
  ...integration.eas && remoteEasFallbackSetting(settings) ? { eas: () => (options.checkEasFallback ?? checkEasFallback)({
706
723
  root,
707
724
  platform: PLATFORM,
725
+ env: context.env,
726
+ operation: context,
708
727
  slot,
709
728
  release,
710
729
  isExpo,
@@ -725,7 +744,10 @@ async function runAndroid(options = {}) {
725
744
  listSystemImages,
726
745
  listDeviceProfiles
727
746
  }),
728
- checkBudget: options.checkBudget,
747
+ checkBudget: (args) => (options.checkBudget ?? budgetGate)({
748
+ ...args,
749
+ env: context.env
750
+ }),
729
751
  note: out,
730
752
  phase,
731
753
  log: (entry) => writer.write(entry),
@@ -747,10 +769,13 @@ async function runAndroid(options = {}) {
747
769
  root,
748
770
  platform: PLATFORM,
749
771
  backend: remoteBackend,
772
+ env: context.env,
773
+ operation: context,
750
774
  easBin: resolveEasBin(root)?.file ?? null
751
775
  }) : null;
752
776
  if (remoteContext && "failed" in remoteContext) return fail(remoteContext.code ?? "STIM_NO_REMOTE_SESSION", remoteContext.failed, remoteContext.remedy);
753
777
  const easBuild = await resolveEasBuild({
778
+ context,
754
779
  root,
755
780
  platform: PLATFORM,
756
781
  profile: easProfile,
@@ -758,10 +783,22 @@ async function runAndroid(options = {}) {
758
783
  isExpo,
759
784
  physical,
760
785
  selectors: [variantFlag],
761
- buildCache: requestedBuildCache
786
+ buildCache: requestedBuildCache,
787
+ env: context.env,
788
+ signal: settingsSignal
789
+ }).catch((error) => {
790
+ const cancelled = cancelledFailure(context, PLATFORM, {
791
+ code: "STIM_CANCELLED",
792
+ message: "during EAS lookup"
793
+ });
794
+ if (cancelled) return {
795
+ ok: false,
796
+ ...cancelled
797
+ };
798
+ throw error;
762
799
  });
763
800
  if (isEasBuildFailure(easBuild)) return fail(easBuild.code, easBuild.message, easBuild.remedy);
764
- const appIds = integration.appIds();
801
+ const appIds = await integration.appIds();
765
802
  let androidPackage = appIds.androidPackage;
766
803
  record.bundleId = androidPackage;
767
804
  const registerProject = () => upsertProject(root, {
@@ -779,6 +816,7 @@ async function runAndroid(options = {}) {
779
816
  async function prepareMetro() {
780
817
  if (metroCheck) {
781
818
  const gate = await ensureDevServer({
819
+ env: context.env,
782
820
  root,
783
821
  port: reservedPort,
784
822
  settings: hostedMetroSettings(settings, Boolean(hostedTarget)),
@@ -807,7 +845,7 @@ async function runAndroid(options = {}) {
807
845
  prepared: { metroPort }
808
846
  };
809
847
  } else {
810
- const pin = metroPortSetting(settings);
848
+ const pin = metroPortSetting(settings, context.env);
811
849
  if (pin.error) return {
812
850
  ok: false,
813
851
  error: {
@@ -842,6 +880,7 @@ async function runAndroid(options = {}) {
842
880
  if (metroPort !== null) {
843
881
  const reachable = await ensureRemoteMetro({
844
882
  ctx: remoteDevice.ctx,
883
+ env: context.env,
845
884
  metroPort,
846
885
  isExpo,
847
886
  tunnelMode: tunnelModeSetting(settings) ?? void 0,
@@ -853,8 +892,9 @@ async function runAndroid(options = {}) {
853
892
  checkCapacity = remoteDevice.checkCapacity;
854
893
  ensureDevice = remoteDevice.ensureDevice;
855
894
  ensureDeviceBooted = remoteDevice.ensureDeviceBooted;
856
- install = remoteDevice.install;
857
- launch = remoteDevice.launch;
895
+ const remote = remoteDevice;
896
+ install = async (args) => remote.install(args);
897
+ launch = async (args) => remote.launch(args);
858
898
  }
859
899
  const emuLog = emulatorLogFile(root);
860
900
  const limits = getLimits();
@@ -902,7 +942,7 @@ async function runAndroid(options = {}) {
902
942
  });
903
943
  } else {
904
944
  if (!remoteDevice) try {
905
- configuredAndroidEmulatorApp();
945
+ await configuredAndroidEmulatorApp();
906
946
  } catch (err) {
907
947
  return fail("STIM_BAD_ARG", err.message, "Run `stim settings set androidEmulatorApp emulator` or `stim settings set androidEmulatorApp stim-desktop`.");
908
948
  }
@@ -963,6 +1003,7 @@ async function runAndroid(options = {}) {
963
1003
  root,
964
1004
  platform: PLATFORM,
965
1005
  sessionName: ownedSessionName(remoteDevice.ctx.label),
1006
+ operation: context,
966
1007
  startedAt: new Date(now()).toISOString(),
967
1008
  boot,
968
1009
  createdSessionId: remoteDevice.createdSessionId,
@@ -994,10 +1035,12 @@ async function runAndroid(options = {}) {
994
1035
  bundleUrl: metroWarmupUrlSetting(settings, "android")
995
1036
  });
996
1037
  const acquiredArtifact = await acquireAndroidArtifact({
1038
+ context,
997
1039
  root,
998
1040
  buildLog,
999
1041
  writer,
1000
1042
  recipe: integration.artifact({
1043
+ operation: context,
1001
1044
  root,
1002
1045
  buildLog,
1003
1046
  writer,
@@ -1059,7 +1102,7 @@ async function runAndroid(options = {}) {
1059
1102
  ccacheActivity = artifact.ccache;
1060
1103
  androidPackage = artifact.androidPackage;
1061
1104
  record.appPath = apkPath;
1062
- if (runCancellation()) return fail("STIM_CANCELLED", "before install");
1105
+ if (runCancellation(context)) return fail("STIM_CANCELLED", "before install");
1063
1106
  if (hostedTarget) return finishHostedAndroidRun({
1064
1107
  target: hostedTarget,
1065
1108
  artifact,
@@ -1152,12 +1195,13 @@ async function runAndroid(options = {}) {
1152
1195
  expiresAt: acquired.status === "leased" ? acquired.expiresAt : null
1153
1196
  });
1154
1197
  if (acquired.status === "leased") {
1155
- stopLeaseSignals = onLeaseSignal(releaseLease);
1198
+ stopLeaseSignals = onLeaseSignal(context, releaseLease);
1156
1199
  phase("lease", `${acquired.kind} lease on ${device.serial} until ${leaseExpiryText(acquired.expiresAt, now())}`);
1157
1200
  }
1158
1201
  }
1159
1202
  try {
1160
1203
  return await finishAndroidRun({
1204
+ operation: context,
1161
1205
  runtime,
1162
1206
  runtimePreparation,
1163
1207
  slot,
@@ -1201,7 +1245,7 @@ async function runAndroid(options = {}) {
1201
1245
  phase,
1202
1246
  fail,
1203
1247
  readApkPackage,
1204
- readProjectPackage: () => integration.appIds().androidPackage,
1248
+ readProjectPackage: async () => (await integration.appIds()).androidPackage,
1205
1249
  packageRemedy: integration.packageRemedy,
1206
1250
  install,
1207
1251
  launch,
@@ -1245,13 +1289,18 @@ async function runAndroid(options = {}) {
1245
1289
  try {
1246
1290
  return await runFromFingerprint();
1247
1291
  } catch (error) {
1292
+ const cancelled = cancelledFailure(context, PLATFORM, {
1293
+ code: "STIM_CANCELLED",
1294
+ message: "while finishing the run"
1295
+ });
1296
+ if (cancelled) return fail(cancelled.code, cancelled.message, cancelled.remedy, { lastBuildStatus: true });
1248
1297
  recordRun({
1249
1298
  failed: true,
1250
1299
  durationMs: now() - started
1251
1300
  });
1252
1301
  throw error;
1253
1302
  } finally {
1254
- preparedArtifact?.release();
1303
+ await preparedArtifact?.release();
1255
1304
  }
1256
1305
  }
1257
1306
  //#endregion
@@ -1,6 +1,6 @@
1
- import { i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-CPDq_90S.mjs";
2
- import { E as resolveVariant, T as resolveSystemImage, _ as findAapt, b as noDeviceDiagnostic, d as androidVariantSetting, f as apkDevClientFacts, g as dumpApkManifest, h as displayPath, i as NO_FINGERPRINT, p as apkPackage, r as NO_DEVICE, s as androidDevClientScheme, u as androidSystemImageSetting, x as parseXmltree, y as isReleaseVariant } from "./support-Ca6PZbpr.mjs";
3
- import { r as lastBuildRecord, t as androidFacts } from "./result-BrfgXtdO.mjs";
4
- import { i as runAndroidOperation, n as registerAndroid, r as runAndroid, t as androidCommand } from "./android-CLbBJ2ve.mjs";
5
- import { a as killPreviousCollector, i as collectorLogFile, o as startCollector } from "./launch-V1zqiOYn.mjs";
1
+ import { i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-B1UrjZHL.mjs";
2
+ import { E as resolveVariant, T as resolveSystemImage, _ as findAapt, b as noDeviceDiagnostic, d as androidVariantSetting, f as apkDevClientFacts, g as dumpApkManifest, h as displayPath, i as NO_FINGERPRINT, p as apkPackage, r as NO_DEVICE, s as androidDevClientScheme, u as androidSystemImageSetting, x as parseXmltree, y as isReleaseVariant } from "./support-67vraa1Q.mjs";
3
+ import { r as lastBuildRecord, t as androidFacts } from "./result-DNiS-tTP.mjs";
4
+ import { i as runAndroidOperation, n as registerAndroid, r as runAndroid, t as androidCommand } from "./android-BLgbNqox.mjs";
5
+ import { a as killPreviousCollector, i as collectorLogFile, o as startCollector } from "./launch-CD1yVc7U.mjs";
6
6
  export { NO_DEVICE, NO_FINGERPRINT, androidDevClientScheme, androidFacts, androidSystemImageSetting, androidVariantSetting, apkDevClientFacts, apkPackage, collectorLogFile, androidCommand as default, displayPath, dumpApkManifest, findAapt, formatDuration, isReleaseVariant, killPreviousCollector, lastBuildRecord, noDeviceDiagnostic, parseXmltree, phaseLine, registerAndroid, resolveSystemImage, resolveVariant, runAndroid, runAndroidOperation, shortHash, startCollector };