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,42 +1,41 @@
1
- import { K as validateDeviceSlot, U as parseDeviceSlotOption, z as deviceSlotFileKey } from "./config-BYDxlMY3.mjs";
2
- import { C as iosSigningIdentitySha1Setting, I as projectSettingsContext, L as publicUrlSetting, N as metroWarmupUrlSetting, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, tt as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting } from "./settings-B717odTD.mjs";
3
- import { i as recordWorkspaceUse, w as workspaceLogsDir$1 } from "./workspace-state-DJt_MMvf.mjs";
4
- import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
5
- import { I as workspaceDevServerMode, t as NO_PROJECT_REFUSAL } from "./project-_phNIJfs.mjs";
6
- import { at as POOL_SETTING_REMEDY, dt as parkedMaxSetting } from "./android-Mz_Inn3w.mjs";
7
- import { At as createRunRecorder, It as statsProjectKey$1, Ot as startBuildProgress, kt as tapBuildLog, yt as NO_BUILD_PROGRESS } from "./budget-f7516Zk0.mjs";
8
- import { S as withNativeBuildRun, b as runCancellation, p as cancelledFailure, x as runCancellationSignal } from "./tailnet-Dh-qiYzG.mjs";
9
- import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DzkMYh8Q.mjs";
10
- import { o as exitAfterFlush } from "./remote-cache-OyOyVIS3.mjs";
11
- import { d as simulatorRuntime, f as setRemoteLogSink, g as parseBuildMachineOption } from "./client-qQAaXSUs.mjs";
12
- import { i as createIosSimSnapshot } from "./ios-RkW4pnQf.mjs";
13
- import { r as DEFAULT_METRO_PORT } from "./app-install-BIKtMfPq.mjs";
14
- import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-k8dTIrbK.mjs";
15
- import { _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-DxSsNssu.mjs";
16
- import "./dev-client-DAWVIGBu.mjs";
17
- import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-Cw2M4z51.mjs";
18
- import { r as hostedMetroSettings } from "./metro-gateway-CX9Xlkq2.mjs";
19
- import { i as writeDevicePlacement } from "./ios-state-CBLe1xYw.mjs";
20
- import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-B7SZsc2N.mjs";
21
- import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-DPt0m9Nd.mjs";
22
- import { S as ownedSessionName, n as binOnPath } from "./device-remote-xRT0Vmo9.mjs";
23
- import { r as isEasBuildFailure } from "./eas-build-JyfqyHfC.mjs";
24
- import { t as didSetUpDevice } from "./device-BECOiufl.mjs";
1
+ import { m as workspaceLogsDir$1 } from "./paths-DQtTgsBf.mjs";
2
+ import { B as deviceSlotFileKey, W as parseDeviceSlotOption, q as validateDeviceSlot } from "./config-DlrsduwG.mjs";
3
+ import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-gwpm28fu.mjs";
4
+ import { i as recordWorkspaceUse } from "./workspace-state-U08dEzhG.mjs";
5
+ import { C as iosSigningIdentitySha1Setting, L as projectSettingsContextAsync, N as metroWarmupUrlSetting, R as publicUrlSetting, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, j as metroPortSetting, rt as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting } from "./settings-C7O8A6ZI.mjs";
6
+ import { L as workspaceDevServerMode, t as NO_PROJECT_REFUSAL } from "./project-wM_XFTvE.mjs";
7
+ import { H as tapBuildLog, In as runProcessOperation, Lt as binOnPath, M as NO_BUILD_PROGRESS, Pn as exitAfterFlush, U as createRunRecorder, V as startBuildProgress, Y as statsProjectKey$1, cn as DEFAULT_METRO_PORT, rr as ownedSessionName } from "./budget-Cvwn54qV.mjs";
8
+ import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-NwUuxbkg.mjs";
9
+ import { _t as parkedMaxSetting, dt as POOL_SETTING_REMEDY } from "./android-C7sVmyI9.mjs";
10
+ import { i as createIosSimSnapshot } from "./ios-hcBpnEGk.mjs";
11
+ import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-ccaPc4ox.mjs";
12
+ import { t as COMPILATION_CACHE_NOT_RUN } from "./xcode-BXn9-xYx.mjs";
13
+ import { d as simulatorRuntime, h as setRemoteLogSink } from "./client-OyRoEuSr.mjs";
14
+ import { i as parseBuildMachineOption } from "./selection-DSMbWEX2.mjs";
15
+ import { r as hostedMetroSettings } from "./metro-gateway-CKZqKqx7.mjs";
16
+ import { i as writeDevicePlacement } from "./ios-state-Dtw5K2aI.mjs";
17
+ import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-CbfmNgM6.mjs";
18
+ import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-xJPQ_QQG.mjs";
19
+ import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-CNioewsd.mjs";
20
+ import { r as isEasBuildFailure } from "./eas-build-CwknaQYj.mjs";
21
+ import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-B7KIafpM.mjs";
22
+ import "./dev-client-BSDR5h3F.mjs";
23
+ import { t as didSetUpDevice } from "./device-B-L3Fbxy.mjs";
25
24
  import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
26
- import { _ as resolveIosWait, a as deviceModelRefusal, b as resolveSimulatorAppFlag, c as iosProjectPathError, d as ownedSimFailure, g as resolveIosBuildSetup, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, r as createIosDeviceWaitRun, u as isReleaseConfiguration, v as resolveRuntime, x as simulatorBuildArch, y as resolveSchemeSelection } from "./support-CwjbFs9H.mjs";
27
- import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-K9hY_Jab.mjs";
28
- import { t as acquireIosArtifact } from "./artifact-HSwkIWEQ.mjs";
29
- import { a as iosPlacementBudget, i as hostedIosSelectors, n as connectIosTarget, o as selectIosPlacement, r as hostedIosMetroNote, t as connectIosBackend } from "./remote-BiR6aYjy.mjs";
30
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-D7pi2Sca.mjs";
31
- import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-C3qJ6Agb.mjs";
25
+ import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-DUC8Ka9y.mjs";
26
+ import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-CZhKODF3.mjs";
27
+ import { t as acquireIosArtifact } from "./artifact-8EY8SAPw.mjs";
28
+ import { a as hostedIosSelectors, i as hostedIosMetroNote, n as connectIosTarget, o as iosPlacementBudget, r as deviceRemoteConflict, s as selectIosPlacement, t as connectIosBackend } from "./remote-DjGDmlTZ.mjs";
29
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device--h_-8ENa.mjs";
30
+ import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-BjxemNpK.mjs";
32
31
  import { basename, join } from "node:path";
33
- import { hostedIosStatus, parseMachine } from "@stim-cli/core/state";
34
32
  import { workspaceId } from "@stim-cli/core";
35
- import { InvalidArgumentError } from "commander";
33
+ import { hostedIosStatus, parseMachine } from "@stim-cli/core/state";
36
34
  import chalk from "chalk";
35
+ import { InvalidArgumentError } from "commander";
37
36
  //#region src/commands/ios/hosted.ts
38
37
  async function finishHostedIosRun({ target, d, artifact, root, slot, release, appMode, isExpo, metroCheck, metroPort, logsDir, fail, note, enterPhase, selectors, projectBundleId, ...report }) {
39
- const bundleId = artifact.bundleId ?? (d.readBundleId(artifact.path) || projectBundleId());
38
+ const bundleId = artifact.bundleId ?? (await d.readBundleId(artifact.path) || await projectBundleId());
40
39
  if (!bundleId) return fail({
41
40
  code: "STIM_INSTALL_FAILED",
42
41
  message: "The built app has no bundle identifier."
@@ -84,7 +83,7 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
84
83
  metroPort,
85
84
  mode: workspaceDevServerMode(root, isExpo),
86
85
  slot: launchSlotScope(root, slot),
87
- platformShared: siblingPlatformSlots(root, "ios", slot).length > 0
86
+ platformShared: (await siblingPlatformSlots(root, "ios", slot)).length > 0
88
87
  });
89
88
  if (evidence.fatal) return fail({
90
89
  code: "STIM_LAUNCH_FAILED",
@@ -145,41 +144,43 @@ function runOnlyFlag(opts) {
145
144
  if (opts.metroCheck === false) return "--no-metro-check";
146
145
  return null;
147
146
  }
148
- async function planIos(opts, d) {
149
- const json = Boolean(opts.json);
147
+ async function readIosBuildPlan(operation, opts, d = DEFAULT_DEPS) {
150
148
  const flag = runOnlyFlag(opts);
151
- if (flag) return refusePlan(planFlagRefusal(flag), json);
152
- const root = d.findProjectRoot(process.cwd());
153
- if (!root) return refusePlan(NO_PROJECT_REFUSAL, json);
149
+ if (flag) return { refusal: planFlagRefusal(flag) };
150
+ const root = d.findProjectRoot(operation.projectRoot);
151
+ if (!root) return { refusal: NO_PROJECT_REFUSAL };
154
152
  const selected = d.projectRegistry.selectIos(root);
155
- if ("problem" in selected) return refusePlan({
153
+ if ("problem" in selected) return { refusal: {
156
154
  code: "STIM_NO_PROJECT",
157
155
  ...selected.problem
158
- }, json);
159
- const context = projectSettingsContext(root, d);
156
+ } };
157
+ const context = await projectSettingsContextAsync(root, d, {
158
+ env: operation.env,
159
+ signal: operation.signal
160
+ });
160
161
  const settings = d.resolveSettings(context);
161
162
  const project = await selected.load(settings);
162
- if (!project.plan) return refusePlan(unsupportedPlan("ios"), json);
163
- const result = await project.plan(opts, {
163
+ if (!project.plan) return { refusal: unsupportedPlan("ios") };
164
+ operation.signal.throwIfAborted();
165
+ return project.plan(opts, {
164
166
  context,
165
167
  settings
166
- });
168
+ }, operation);
169
+ }
170
+ async function planIos(opts, d) {
171
+ const json = Boolean(opts.json);
172
+ const { value: result, interrupted } = await runProcessOperation(process.cwd(), (operation) => readIosBuildPlan(operation, opts, d));
167
173
  if ("platform" in result) printPlan(result, json);
168
174
  else refusePlan(result.refusal, json, result.lines);
175
+ if (interrupted) process.exitCode = interrupted;
169
176
  }
170
177
  //#endregion
171
178
  //#region src/commands/ios.ts
172
- function writeNote(line) {
173
- console.error(line);
174
- }
175
- function writePhase(name, text) {
176
- console.error(phaseLine(name, text));
177
- }
178
179
  function iosCommand(program) {
179
180
  registerIos(program);
180
181
  }
181
182
  function registerIos(program, deps = {}) {
182
- program.command("ios").description("Build (or restore from the fingerprint cache), install and launch this workspace's app on its owned simulator. 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("--scheme <name>", "Shared Xcode app scheme to build; overrides automatic scheme selection, not the app URL scheme").option("--no-metro-check", "Skip the \"is this workspace's dev server running?\" check: do not start it, and build anyway").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("--configuration <name>", "Xcode configuration to build (e.g. Release). A non-Debug configuration embeds the JS bundle and skips Metro entirely. Overrides the ios.configuration setting. Default: Debug").option("--device-type <name>", "Simulator model to create this workspace's owned sim as, exactly as `xcrun simctl list devicetypes` names it (e.g. \"iPad Pro 13-inch (M5)\"). Overrides the ios.deviceType setting for this invocation. A model no installed runtime can create refuses with STIM_BAD_ARG and prints the models they do offer.").option("--runtime <version>", "Simulator runtime to create this workspace's owned sim on, as a version (\"18.5\") or a runtime's full name (\"iOS 18.5\"); nothing else matches. Overrides the ios.runtime setting for this invocation. An unknown version refuses with STIM_BAD_ARG and prints the installed runtimes.").option("--simulator-app <app>", "Open the owned simulator in xcode, siniulator, or stim-desktop for this run, overriding the machine iosSimulatorApp setting. Also opens an already running simulator; local simulators only.").option("--device [udid]", "Build the iphoneos slice for a connected iPhone, install it, and launch it, instead of using this workspace's owned simulator. The phone can be cabled or paired over Wi-Fi. With no UDID, the first cabled device this workspace can lease is used, waiting for one that is busy; a Wi-Fi device is used only when no cabled one is connected and ready. In Debug the app is wired to this workspace's Metro over the LAN. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or an approved Mac in remote.machines; named Macs never fall back locally. auto places on an approved Mac when this Mac is full or busy. local runs here, whatever ios.remote says.", (value) => {
183
+ program.command("ios").description("Build (or restore from the fingerprint cache), install and launch this workspace's app on its owned simulator. 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("--scheme <name>", "Shared Xcode app scheme to build; overrides automatic scheme selection, not the app URL scheme").option("--no-metro-check", "Skip the \"is this workspace's dev server running?\" check: do not start it, and build anyway").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("--configuration <name>", "Xcode configuration to build (e.g. Release). A non-Debug configuration embeds the JS bundle and skips Metro entirely. Overrides the ios.configuration setting. Default: Debug").option("--device-type <name>", "Simulator model to create this workspace's owned sim as, exactly as `xcrun simctl list devicetypes` names it (e.g. \"iPad Pro 13-inch (M5)\"). Overrides the ios.deviceType setting for this invocation. A model no installed runtime can create refuses with STIM_BAD_ARG and prints the models they do offer.").option("--runtime <version>", "Simulator runtime to create this workspace's owned sim on, as a version (\"18.5\") or a runtime's full name (\"iOS 18.5\"); nothing else matches. Overrides the ios.runtime setting for this invocation. An unknown version refuses with STIM_BAD_ARG and prints the installed runtimes.").option("--simulator-app <app>", "Open the owned simulator in xcode, siniulator, or stim-desktop for this run, overriding the machine iosSimulatorApp setting. Also opens an already running simulator; local simulators only.").option("--device [udid]", "Build the iphoneos slice for a connected iPhone, install it, and launch it, instead of using this workspace's owned simulator. The phone can be cabled or paired over Wi-Fi. With no UDID, the first cabled device this workspace can lease is used, waiting for one that is busy; a Wi-Fi device is used only when no cabled one is connected and ready. In Debug the app is wired to this workspace's Metro over the LAN. Stim never creates, boots, or deletes a physical device.").option("--remote <target>", "Run on eas, proxy, or an approved Mac in remote.machines; named Macs never fall back locally. auto places on an approved Mac when this machine is full or busy. local runs here, whatever ios.remote says.", (value) => {
183
184
  if (parseMachine(value)) return value.trim();
184
185
  throw new InvalidArgumentError("expected eas, proxy, auto, local, or a remote Mac name");
185
186
  }).option("--wait <seconds>", "How long to wait for another workspace to release the phone 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 phone 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) => {
@@ -190,38 +191,39 @@ function registerIos(program, deps = {}) {
190
191
  });
191
192
  return;
192
193
  }
193
- const completion = await runIosOperation((deps.findProjectRoot ?? DEFAULT_DEPS.findProjectRoot)(process.cwd()), {
194
+ const root = (deps.findProjectRoot ?? DEFAULT_DEPS.findProjectRoot)(process.cwd());
195
+ const { value: completion, interrupted } = await runProcessOperation(root ?? process.cwd(), (context) => runIosOperation(context, root, {
194
196
  ...opts,
195
197
  waitConflict: waitFlagConflict(process.argv)
196
- }, deps);
197
- if (!completion) process.exit(runCancellation() ? 130 : 1);
198
+ }, deps));
199
+ if (!completion) process.exit(interrupted ?? 1);
198
200
  else if (completion.uploadsAbandoned) exitAfterFlush(0);
199
201
  });
200
202
  }
201
- function runIosOperation(root, opts = {}, deps = {}, onFailure = () => {}) {
202
- const run = (progress) => runIos(root, opts, deps, progress, onFailure);
203
- return root ? withNativeBuildRun(root, {
203
+ function runIosOperation(context, root, opts = {}, deps = {}, onFailure = () => {}) {
204
+ const run = (progress) => runIos(context, root, opts, deps, progress, onFailure);
205
+ return root ? withNativeBuildRun(context, root, {
204
206
  command: "ios",
205
207
  platform: "ios",
206
208
  slot: opts.slot ?? "default"
207
209
  }, async (claim) => {
208
- recordWorkspaceUse(root);
210
+ recordWorkspaceUse(root, /* @__PURE__ */ new Date(), context.env, context.cwd);
209
211
  const progress = startBuildProgress({
210
212
  root,
211
213
  platform: "ios",
212
214
  slot: opts.slot ?? "default",
213
215
  claim,
214
- note: (line) => writeNote(chalk.dim(line))
216
+ note: (line) => context.output("stderr", `${chalk.dim(line)}\n`)
215
217
  });
216
218
  try {
217
219
  return await run(progress);
218
220
  } finally {
219
221
  progress.clear();
220
222
  }
221
- }, { write: (line) => writeNote(chalk.dim(phaseLine("lock", line))) }) : run();
223
+ }, { write: (line) => context.output("stderr", `${chalk.dim(phaseLine("lock", line))}\n`) }) : run();
222
224
  }
223
- function unlessCancelled(result) {
224
- if (!result.ok || !runCancellation()) return result;
225
+ function unlessCancelled(context, result) {
226
+ if (!result.ok || !runCancellation(context)) return result;
225
227
  return {
226
228
  ok: false,
227
229
  failure: {
@@ -312,7 +314,7 @@ function iosSlotDeps(d, slot) {
312
314
  }
313
315
  return d;
314
316
  }
315
- async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUILD_PROGRESS, onFailure) {
317
+ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress = NO_BUILD_PROGRESS, onFailure) {
316
318
  const slot = validateDeviceSlot(opts.slot);
317
319
  let d = iosSlotDeps({
318
320
  ...DEFAULT_DEPS,
@@ -320,8 +322,9 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
320
322
  }, slot);
321
323
  const json = Boolean(opts.json);
322
324
  const metroCheck = opts.metroCheck !== false;
323
- const phase = writePhase;
324
- const note = writeNote;
325
+ const note = (line) => context.output("stderr", `${line}\n`);
326
+ const phase = (name, text) => note(phaseLine(name, text));
327
+ const emit = (line) => context.output("stdout", `${line}\n`);
325
328
  const started = d.now();
326
329
  const startedAt = new Date(started).toISOString();
327
330
  const elapsed = () => d.now() - started;
@@ -329,7 +332,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
329
332
  note(chalk.red(phaseLine("error", message)));
330
333
  note(chalk.dim(phaseLine("remedy", remedy)));
331
334
  note(chalk.red(phaseLine("failed", "STIM_NO_PROJECT")));
332
- if (json) console.log(JSON.stringify({
335
+ if (json) emit(JSON.stringify({
333
336
  code: "STIM_NO_PROJECT",
334
337
  message,
335
338
  remedy
@@ -352,7 +355,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
352
355
  const message = `Could not prepare this workspace's Stim state: ${error?.message || error}`;
353
356
  note(chalk.red(`${code}: ${message}`));
354
357
  note(chalk.dim("Check that STIM_HOME is writable and has free space. An EPERM on a directory you can write is a sandbox: allow writes to STIM_HOME, or run Stim with the sandbox disabled (`stim guide errors sandbox`)."));
355
- if (json) console.log(JSON.stringify({
358
+ if (json) emit(JSON.stringify({
356
359
  code,
357
360
  message,
358
361
  remedy: "Check that STIM_HOME is writable and has free space."
@@ -374,7 +377,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
374
377
  slot
375
378
  }
376
379
  }), progress);
377
- setRemoteLogSink((record) => logWriter().write(record));
380
+ setRemoteLogSink(context, (record) => logWriter().write(record));
378
381
  let leaseHandle = null;
379
382
  let stopLeaseSignals = null;
380
383
  const releaseLease = () => {
@@ -397,15 +400,15 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
397
400
  phases: () => progress.durations(),
398
401
  deviceSetup: () => progress.deviceSetupKnown()
399
402
  });
400
- const deviceWaitRun = createIosDeviceWaitRun(stats, progress, runCancellationSignal());
403
+ const deviceWaitRun = createIosDeviceWaitRun(stats, progress, runCancellationSignal(context));
401
404
  const recordRun = deviceWaitRun.record;
402
405
  let compilationCache = COMPILATION_CACHE_NOT_RUN;
403
406
  let reclaimed = [];
404
407
  let buildMachine = "auto";
405
408
  let devicePlacement;
406
409
  let builtConfiguration = null;
407
- const fail = ({ code, message, remedy = null, lines = [], logPath = null, build = null, lease, setup = false }) => {
408
- ({code, message, remedy, lines} = cancelledFailure("ios", {
410
+ const fail = ({ retainedClaimRoots, code, message, remedy = null, lines = [], logPath = null, build = null, lease, setup = false }) => {
411
+ ({code, message, remedy, lines} = cancelledFailure(context, "ios", {
409
412
  code,
410
413
  message
411
414
  }) ?? {
@@ -434,7 +437,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
434
437
  failed: true,
435
438
  durationMs: elapsed()
436
439
  });
437
- if (json) console.log(JSON.stringify({
440
+ if (json) emit(JSON.stringify({
438
441
  code,
439
442
  message: message ?? null,
440
443
  remedy: remedy ?? null,
@@ -452,11 +455,26 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
452
455
  logPath,
453
456
  build,
454
457
  lease,
455
- setup
458
+ setup,
459
+ ...retainedClaimRoots ? { retainedClaimRoots } : {}
456
460
  });
457
461
  return null;
458
462
  };
459
- const settingsContext = projectSettingsContext(root, d);
463
+ const settingsSignal = runCancellationSignal(context) ?? context.signal;
464
+ let settingsContext;
465
+ try {
466
+ settingsContext = await projectSettingsContextAsync(root, d, {
467
+ env: context.env,
468
+ signal: settingsSignal
469
+ });
470
+ } catch (error) {
471
+ if (!settingsSignal.aborted) throw error;
472
+ return fail({
473
+ code: "STIM_CANCELLED",
474
+ message: "before resolving project settings",
475
+ setup: true
476
+ });
477
+ }
460
478
  const projectKey = statsProjectKey$1({
461
479
  root,
462
480
  commonDir: settingsContext.gitCommonDir,
@@ -470,7 +488,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
470
488
  platform: "ios"
471
489
  });
472
490
  const settings = d.resolveSettings(settingsContext);
473
- const setup = resolveIosBuildSetup(opts.remoteBuild, settings, (label, message) => note(phaseLine(label, chalk.yellow(message))));
491
+ const setup = resolveIosBuildSetup(opts.remoteBuild, settings, (label, message) => note(phaseLine(label, chalk.yellow(message))), context.env);
474
492
  if (!setup.ok) return fail(setup.failure);
475
493
  buildMachine = setup.buildMachine;
476
494
  const { optimizations } = setup;
@@ -512,11 +530,8 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
512
530
  message: "--device was given an empty UDID.",
513
531
  remedy: "Pass `--device` on its own to take the first connected device this workspace can lease, or `--device <udid>` to name one."
514
532
  });
515
- if (physical && opts.remote) return fail({
516
- code: "STIM_BAD_ARG",
517
- message: "--device builds for a phone connected to this machine, and --remote installs on a remote one.",
518
- remedy: "Pass only one of --device and --remote."
519
- });
533
+ const remoteConflict = deviceRemoteConflict(opts.remote, physical);
534
+ if (remoteConflict) return fail(remoteConflict);
520
535
  const wait = resolveIosWait(opts, physical);
521
536
  if ("failure" in wait) return fail(wait.failure);
522
537
  const { waitSeconds, noWait, deviceSlotWaitMs, checkCapacity } = wait;
@@ -532,7 +547,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
532
547
  }
533
548
  };
534
549
  const isExpo = integration.isExpo;
535
- const schemeRefusal = integration.schemeProblem(buildScheme, configuration);
550
+ const schemeRefusal = await integration.schemeProblem(buildScheme, configuration);
536
551
  if (schemeRefusal) return fail(schemeRefusal);
537
552
  const capabilityRefusal = iosProjectTargetRefusal(integration, {
538
553
  physical,
@@ -541,6 +556,8 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
541
556
  if (capabilityRefusal) return fail(capabilityRefusal);
542
557
  const remoteSelection = await selectIosPlacement({
543
558
  root,
559
+ env: context.env,
560
+ operation: context,
544
561
  slot,
545
562
  opts,
546
563
  settings,
@@ -562,7 +579,8 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
562
579
  remoteBackend: null,
563
580
  deviceTypeOrigin: d.settingOriginScope(d.settingsLayers(settingsContext), "ios.deviceType"),
564
581
  runtimeOrigin: d.settingOriginScope(d.settingsLayers(settingsContext), "ios.runtime"),
565
- listRuntimes: d.listIosRuntimes
582
+ listRuntimes: d.listIosRuntimes,
583
+ signal: context.signal
566
584
  }),
567
585
  noWait: deviceSlotWaitMs === 0,
568
586
  note,
@@ -583,7 +601,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
583
601
  if ("refusal" in viewer) return fail(viewer.refusal);
584
602
  const { simulatorApp } = viewer;
585
603
  const settingsLayersForOrigin = d.settingsLayers(settingsContext);
586
- const modelRefusal = deviceModelRefusal({
604
+ const modelRefusal = await deviceModelRefusal({
587
605
  slot,
588
606
  deviceTypeFlag: opts.deviceType,
589
607
  runtimeFlag: opts.runtime,
@@ -594,7 +612,8 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
594
612
  physical,
595
613
  remoteBackend,
596
614
  hosted: Boolean(hostedMachine),
597
- listRuntimes: d.listIosRuntimes
615
+ listRuntimes: d.listIosRuntimes,
616
+ signal: context.signal
598
617
  });
599
618
  if (modelRefusal) return fail(modelRefusal);
600
619
  const selectors = hostedIosSelectors(deviceType, runtime);
@@ -603,10 +622,10 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
603
622
  const hostedTarget = connected.target;
604
623
  try {
605
624
  const simSnapshot = createIosSimSnapshot();
606
- const budget = await iosPlacementBudget(d, root, note, Boolean(hostedTarget), remoteSelection.budget, simSnapshot);
625
+ const budget = await iosPlacementBudget(d, root, note, Boolean(hostedTarget), remoteSelection.budget, simSnapshot, context.env);
607
626
  reclaimed = budget.reclaimed;
608
627
  if (budget.refusal) return fail(budget.refusal);
609
- const backendConnection = await connectIosBackend(root, remoteBackend, opts.deviceType, d);
628
+ const backendConnection = await connectIosBackend(root, remoteBackend, opts.deviceType, d, context.env, context);
610
629
  if ("failure" in backendConnection) return fail(backendConnection.failure);
611
630
  const remoteDevice = backendConnection.remote;
612
631
  const remoteArch = hostedTarget ? hostedTarget.choice.architecture : backendConnection.arch;
@@ -615,10 +634,11 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
615
634
  checkDeviceCapacity: remoteDevice.checkDeviceCapacity,
616
635
  ensureOwnedDevice: remoteDevice.ensureOwnedDevice,
617
636
  ensureBooted: remoteDevice.ensureBooted,
618
- installIosApp: remoteDevice.installIosApp,
619
- launchIosApp: remoteDevice.launchIosApp
637
+ installIosApp: async (args) => remoteDevice.installIosApp(args),
638
+ launchIosApp: async (args) => remoteDevice.launchIosApp(args)
620
639
  };
621
640
  const easBuild = await d.resolveEasDevelopmentBuild({
641
+ context,
622
642
  root,
623
643
  platform: "ios",
624
644
  profile: opts.easProfile,
@@ -626,14 +646,26 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
626
646
  isExpo,
627
647
  physical,
628
648
  selectors: [opts.scheme, opts.configuration],
629
- buildCache: opts.buildCache
649
+ buildCache: opts.buildCache,
650
+ env: context.env,
651
+ signal: settingsSignal
652
+ }).catch((error) => {
653
+ const cancelled = cancelledFailure(context, "ios", {
654
+ code: "STIM_CANCELLED",
655
+ message: "during EAS lookup"
656
+ });
657
+ if (cancelled) return {
658
+ ok: false,
659
+ ...cancelled
660
+ };
661
+ throw error;
630
662
  });
631
663
  if (isEasBuildFailure(easBuild)) return fail(easBuild);
632
- const registerProject = () => d.upsertProject(root, {
633
- bundleId: integration.bundleId() ?? void 0,
664
+ const registerProject = async () => d.upsertProject(root, {
665
+ bundleId: await integration.bundleId() ?? void 0,
634
666
  isExpo
635
667
  });
636
- if (remoteBackend !== "eas") registerProject();
668
+ if (remoteBackend !== "eas") await registerProject();
637
669
  const proj = d.getProject(root);
638
670
  const limits = d.getConcurrencyLimits();
639
671
  let physicalDevice = null;
@@ -643,13 +675,13 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
643
675
  root,
644
676
  platform: "ios",
645
677
  idLabel: "udid",
646
- list: () => iosPoolCandidates(d.listIosDevices()).map((entry) => ({
678
+ list: async () => iosPoolCandidates(await d.listIosDevices()).map((entry) => ({
647
679
  id: entry.udid,
648
680
  name: entry.name,
649
681
  fallback: isWirelessIosDevice(entry)
650
682
  })),
651
- noCandidates: () => {
652
- const resolved = iosPoolNoCandidatesRefusal(d.listIosDevices());
683
+ noCandidates: async () => {
684
+ const resolved = iosPoolNoCandidatesRefusal(await d.listIosDevices());
653
685
  return {
654
686
  message: resolved.error,
655
687
  remedy: resolved.remedy
@@ -672,7 +704,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
672
704
  };
673
705
  wireless = pooled.candidate.fallback === true;
674
706
  } else if (physical) {
675
- const resolved = resolveIosPhysicalDevice(typeof deviceFlag === "string" ? deviceFlag : null, d.listIosDevices());
707
+ const resolved = resolveIosPhysicalDevice(typeof deviceFlag === "string" ? deviceFlag : null, await d.listIosDevices());
676
708
  if (!resolved.udid) return fail({
677
709
  code: "STIM_NO_DEVICE",
678
710
  message: resolved.error,
@@ -769,6 +801,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
769
801
  async function prepareMetro() {
770
802
  if (metroCheck) {
771
803
  const gate = await ensureDevServer({
804
+ env: context.env,
772
805
  root,
773
806
  port: metroPort,
774
807
  settings: hostedMetroSettings(settings, Boolean(hostedTarget)),
@@ -786,13 +819,14 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
786
819
  code: gate.code,
787
820
  message: gate.message,
788
821
  remedy: gate.remedy,
789
- lines: gate.lines
822
+ lines: gate.lines,
823
+ ...gate.retainedClaimRoots ? { retainedClaimRoots: gate.retainedClaimRoots } : {}
790
824
  }
791
825
  };
792
826
  metroPort = gate.port;
793
827
  devServer = gate.devServer;
794
828
  } else {
795
- const pin = metroPortSetting(settings);
829
+ const pin = metroPortSetting(settings, context.env);
796
830
  if (pin.error) return {
797
831
  ok: false,
798
832
  error: {
@@ -815,6 +849,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
815
849
  if (remoteDevice && metroPort !== null) {
816
850
  const reachable = await d.ensureMetroReachable({
817
851
  ctx: remoteDevice.ctx,
852
+ env: context.env,
818
853
  metroPort,
819
854
  isExpo,
820
855
  tunnelMode: tunnelModeSetting(settings) ?? void 0,
@@ -877,6 +912,21 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
877
912
  return null;
878
913
  }
879
914
  let artifact = null;
915
+ const reportRunFailure = (error) => {
916
+ const cancelled = cancelledFailure(context, "ios", {
917
+ code: "STIM_CANCELLED",
918
+ message: "while finishing the run"
919
+ });
920
+ if (cancelled) return fail({
921
+ ...cancelled,
922
+ build: artifact?.failureFields
923
+ });
924
+ recordRun({
925
+ failed: true,
926
+ durationMs: elapsed()
927
+ });
928
+ throw error;
929
+ };
880
930
  try {
881
931
  const boot = () => physicalDevice ? Promise.resolve({
882
932
  ok: true,
@@ -899,6 +949,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
899
949
  root,
900
950
  platform: "ios",
901
951
  sessionName: ownedSessionName(remoteDevice.ctx.label),
952
+ operation: context,
902
953
  startedAt: new Date(d.now()).toISOString(),
903
954
  deviceType: remoteDevice.ctx.deviceType ?? null,
904
955
  boot,
@@ -924,13 +975,15 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
924
975
  hostArch: d.hostSimulatorArch(),
925
976
  configuration
926
977
  });
927
- const acquiredArtifact = unlessCancelled(await acquireIosArtifact({
978
+ const acquiredArtifact = unlessCancelled(context, await acquireIosArtifact({
979
+ context,
928
980
  root,
929
981
  logFile,
930
982
  configuration,
931
983
  buildMachine,
932
984
  physical,
933
985
  recipe: integration.artifact({
986
+ operation: context,
934
987
  root,
935
988
  logFile,
936
989
  configuration,
@@ -983,6 +1036,7 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
983
1036
  artifact = acquiredArtifact.artifact;
984
1037
  compilationCache = artifact.cache.compilation;
985
1038
  if (hostedTarget) return await finishHostedIosRun({
1039
+ output: context.output,
986
1040
  target: hostedTarget,
987
1041
  projectBundleId: integration.bundleId,
988
1042
  root,
@@ -1043,12 +1097,14 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
1043
1097
  expiresAt: acquired.status === "leased" ? acquired.expiresAt : null
1044
1098
  });
1045
1099
  if (acquired.status === "leased") {
1046
- stopLeaseSignals = d.releaseLeaseOnSignal(releaseLease);
1100
+ stopLeaseSignals = d.releaseLeaseOnAbort(context, releaseLease);
1047
1101
  phase("lease", `${acquired.kind} lease on ${physicalDevice.udid} until ${leaseExpiryText(acquired.expiresAt, d.now())}`);
1048
1102
  }
1049
1103
  }
1050
1104
  try {
1051
1105
  return await finishIosRun({
1106
+ operation: context,
1107
+ output: context.output,
1052
1108
  projectBundleId: integration.bundleId,
1053
1109
  runtime: appRuntime,
1054
1110
  runtimePreparation,
@@ -1095,13 +1151,9 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
1095
1151
  releaseLease();
1096
1152
  }
1097
1153
  } catch (error) {
1098
- recordRun({
1099
- failed: true,
1100
- durationMs: elapsed()
1101
- });
1102
- throw error;
1154
+ return reportRunFailure(error);
1103
1155
  } finally {
1104
- artifact?.release();
1156
+ await artifact?.release();
1105
1157
  }
1106
1158
  } finally {
1107
1159
  await deviceWaitRun.finish();
@@ -1109,4 +1161,4 @@ async function runIos(projectRoot, opts = {}, overrides = {}, progress = NO_BUIL
1109
1161
  }
1110
1162
  }
1111
1163
  //#endregion
1112
- export { registerIos as n, runIosOperation as r, iosCommand as t };
1164
+ export { readIosBuildPlan as i, registerIos as n, runIosOperation as r, iosCommand as t };
@@ -1,11 +1,9 @@
1
- import { y as workspaceAgentDeviceDir } from "./workspace-state-DJt_MMvf.mjs";
2
- import { i as formatDuration, l as phaseLine } from "./command-output-BTy8hZ0F.mjs";
3
- import { i as workspaceLinkLine } from "./stim-desktop-BzBN2Em2.mjs";
4
- import { Dt as recordFinishedBuild } from "./budget-f7516Zk0.mjs";
5
- import { a as easAuthNote, n as UPLOAD_TIMEOUT_MS, r as cacheLevel, s as isEasAuthFailureText } from "./remote-cache-OyOyVIS3.mjs";
6
- import "./launch-verify-B6Q8hZP-.mjs";
7
- import { S as compilationCacheActivityLine, _ as COMPILATION_CACHE_NOT_RUN } from "./toolchain-DxSsNssu.mjs";
8
- import { i as deviceLabel } from "./support-CwjbFs9H.mjs";
1
+ import { l as workspaceAgentDeviceDir } from "./paths-DQtTgsBf.mjs";
2
+ import { i as formatDuration, l as phaseLine } from "./command-output-gwpm28fu.mjs";
3
+ import { B as recordFinishedBuild, Hn as isEasAuthFailureText, Rn as UPLOAD_TIMEOUT_MS, Vn as easAuthNote, zn as cacheLevel } from "./budget-Cvwn54qV.mjs";
4
+ import { a as workspaceLinkLine } from "./stim-desktop-D5OGpYZM.mjs";
5
+ import { o as compilationCacheActivityLine, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-BXn9-xYx.mjs";
6
+ import { i as deviceLabel } from "./support-CNioewsd.mjs";
9
7
  import { buildDiagnostics } from "@stim-cli/core/state";
10
8
  import chalk from "chalk";
11
9
  //#region src/commands/ios/result.ts
@@ -93,7 +91,9 @@ async function finishIosUpload(uploadPending, remote, phase, note) {
93
91
  }
94
92
  return false;
95
93
  }
96
- function reportIosResult({ devicePlacement, host, slot, root, json, release, runtimeKind = release ? "embedded-js" : "metro", configuration, buildScheme = null, metroCheck, metroPort, logsDir, device, udid, appPath, bundleId, installSkipped, elapsed, startedAt, storeHash, storeKey, cacheHit, missReason, compilationCache, useBuildCache, waitedForBuild, launchState, launchWarning, providerName, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null, closeWriter, webPreviewUrl, lease, recordRun, reclaimed = [], devServer = null, links }) {
94
+ function reportIosResult({ output, devicePlacement, host, slot, root, json, release, runtimeKind = release ? "embedded-js" : "metro", configuration, buildScheme = null, metroCheck, metroPort, logsDir, device, udid, appPath, bundleId, installSkipped, elapsed, startedAt, storeHash, storeKey, cacheHit, missReason, compilationCache, useBuildCache, waitedForBuild, launchState, launchWarning, providerName, buildMachine = "auto", builtOn, offloadedTo = null, offloadFallback = null, closeWriter, webPreviewUrl, lease, recordRun, reclaimed = [], devServer = null, links }) {
95
+ const emit = (line) => output("stdout", `${line}\n`);
96
+ const note = (line) => output("stderr", `${line}\n`);
97
97
  const durationMs = elapsed();
98
98
  recordRun({
99
99
  failed: false,
@@ -153,7 +153,7 @@ function reportIosResult({ devicePlacement, host, slot, root, json, release, run
153
153
  });
154
154
  if (devicePlacement) facts.devicePlacement = devicePlacement;
155
155
  if (host) facts.host = host;
156
- if (json) console.log(JSON.stringify({
156
+ if (json) emit(JSON.stringify({
157
157
  ...facts,
158
158
  ...links ? { links } : {},
159
159
  ...reclaimed.length ? { reclaimed } : {}
@@ -164,7 +164,7 @@ function reportIosResult({ devicePlacement, host, slot, root, json, release, run
164
164
  const deviceName = device?.deviceName ?? device?.name ?? udid;
165
165
  const cacheResult = useBuildCache ? cacheDescription(cacheHit, providerName, offloadedTo) : `bypassed; ${cacheDescription(false, null, offloadedTo)}`;
166
166
  const metroResult = runtimeKind === "process" ? "native process (no Metro)" : runtimeKind === "embedded-js" ? `embedded (${configuration})` : !metroCheck ? `check skipped on port ${metroPort}` : launchState === "unverified" ? `state unverified on port ${metroPort}` : `running on port ${metroPort}${devServer ? ` (started: ${devServer.reason})` : ""}`;
167
- console.log([
167
+ emit([
168
168
  outcome,
169
169
  phaseLine("device", host ? `${deviceName} (iOS ${device.runtime?.replace(/^iOS /, "")}) on ${host.machine}` : `${deviceName} (${udid})`),
170
170
  phaseLine("app", bundleId),
@@ -174,8 +174,8 @@ function reportIosResult({ devicePlacement, host, slot, root, json, release, run
174
174
  phaseLine("logs", logsDir),
175
175
  phaseLine("agent-device", `AGENT_DEVICE_STATE_DIR=${workspaceAgentDeviceDir(root)}`)
176
176
  ].join("\n"));
177
- if (facts.webPreviewUrl) console.error(chalk.dim(`Watch this device: ${facts.webPreviewUrl}`));
178
- if (links) console.error(chalk.dim(workspaceLinkLine(links)));
177
+ if (facts.webPreviewUrl) note(chalk.dim(`Watch this device: ${facts.webPreviewUrl}`));
178
+ if (links) note(chalk.dim(workspaceLinkLine(links)));
179
179
  }
180
180
  return facts;
181
181
  }