stim 1.23.1 → 1.25.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 (174) hide show
  1. package/README.md +3 -2
  2. package/dist/{acquire-artifact-BzYRDgaP.mjs → acquire-artifact-zA4S7RHE.mjs} +2 -2
  3. package/dist/{act-vxiMwdf5.mjs → act-BbHS3oV8.mjs} +41 -26
  4. package/dist/{activity-BpWUPgUm.mjs → activity-BpjwrQXU.mjs} +6 -6
  5. package/dist/{agent-device-usage-output-CUlLsbRt.mjs → agent-device-usage-output-Bnkerfod.mjs} +5 -5
  6. package/dist/{android-DtfRGLcc.mjs → android-BGwuK3Mc.mjs} +75 -50
  7. package/dist/{android-CLi6DSiS.mjs → android-CNZgRC-4.mjs} +5 -5
  8. package/dist/{android-C7sVmyI9.mjs → android-Cjcj8MCw.mjs} +140 -46
  9. package/dist/{android-cas-ngferVq2.mjs → android-cas-BVqh2Zep.mjs} +3 -3
  10. package/dist/android-cas-compiler.mjs +1 -1
  11. package/dist/{android-project-DVWyCbWU.d.mts → android-project-CTYaETc0.d.mts} +6 -2
  12. package/dist/{android-DR5lZ2Az.mjs → android-saBeB4lr.mjs} +13 -3
  13. package/dist/api.d.mts +22 -5
  14. package/dist/api.mjs +32 -31
  15. package/dist/{artifact-Xvgibgzq.mjs → artifact-Co8zixVx.mjs} +19 -17
  16. package/dist/{artifact-DBI3DALs.mjs → artifact-DN8JNwqS.mjs} +18 -17
  17. package/dist/{artifact-platform-CXcmX_j3.mjs → artifact-platform-CMRc0M_r.mjs} +3 -3
  18. package/dist/{browser-web-BJN9ZHxB.mjs → browser-web-CCgZsHmI.mjs} +16 -17
  19. package/dist/{budget-3ivAK99e.mjs → budget-HyShrIpL.mjs} +149 -47
  20. package/dist/{build-Dv9s8Fz-.mjs → build-CAiw8Ezm.mjs} +33 -29
  21. package/dist/{build-cache-Dv7RN200.mjs → build-cache-CKCzxzxA.mjs} +172 -21
  22. package/dist/{build-plan-BmbdHQbr.mjs → build-plan-zCuHGlA8.mjs} +8 -7
  23. package/dist/{cache-manifest-DSeQjt-Q.mjs → cache-manifest-BPXRONJz.mjs} +1 -1
  24. package/dist/cache-manifest.mjs +1 -1
  25. package/dist/{ccache-CH2EWGPB.mjs → ccache-h1FKhZeg.mjs} +6 -6
  26. package/dist/{cdp-3fwICjzi.mjs → cdp-BG3FJCCx.mjs} +1 -1
  27. package/dist/{chrome-Bbw689-6.mjs → chrome-BvV8ssI3.mjs} +1 -1
  28. package/dist/{cli-BkK6Wr5i.mjs → cli-C4w607Pz.mjs} +20 -20
  29. package/dist/cli.mjs +1 -1
  30. package/dist/{client-B4MMzfo_.mjs → client-BQsmyp_-.mjs} +274 -39
  31. package/dist/collector-run.mjs +6 -6
  32. package/dist/{command-output-YKGWivpG.mjs → command-output-BBvS1H6v.mjs} +3 -2
  33. package/dist/{config-DlrsduwG.mjs → config-BZhXY15H.mjs} +3 -3
  34. package/dist/{created-devices-x9rN6bhs.mjs → created-devices-D2Aca-xu.mjs} +6 -2
  35. package/dist/{dependency-state-1I9KZT1Y.mjs → dependency-state-BwNCYG5Q.mjs} +2 -2
  36. package/dist/{detached-entry-BwNEtIrP.mjs → detached-entry-KmieOKgN.mjs} +1 -1
  37. package/dist/{dev-client-BFxiDpkf.mjs → dev-client-CHoXXZeg.mjs} +3 -3
  38. package/dist/{device-CiNYxqp6.mjs → device-B9FqTBYW.mjs} +81 -54
  39. package/dist/{device-B7ljwccX.mjs → device-F5-4z9ef.mjs} +16 -16
  40. package/dist/{device-capacity-DH0QsZYZ.mjs → device-capacity-ZYaRALv5.mjs} +20 -16
  41. package/dist/device-host-worker.mjs +17 -17
  42. package/dist/{device-ios-CbVDtDIy.mjs → device-ios-DkHBrmvH.mjs} +32 -50
  43. package/dist/{device-lease-run-DXPSwdbb.mjs → device-lease-run-ogEeJ62K.mjs} +6 -6
  44. package/dist/{device-pool-B4iOXIrD.mjs → device-pool-BIg8MU8l.mjs} +3 -3
  45. package/dist/{doctor-DRu-8ld6.mjs → doctor-A_Nr_fDe.mjs} +1 -1
  46. package/dist/{doctor-HUC1igzw.mjs → doctor-Bm8TVpGn.mjs} +37 -31
  47. package/dist/{doctor-fingerprint-DZLoYFVb.mjs → doctor-fingerprint-zlujA1Gs.mjs} +1 -1
  48. package/dist/doctor-fingerprint.mjs +1 -1
  49. package/dist/{doctor-C6t4Maue.mjs → doctor-k3P3PizH.mjs} +14 -14
  50. package/dist/{doctor-watchman-iGBpC6KM.mjs → doctor-watchman-BovI1y3-.mjs} +5 -5
  51. package/dist/{eas-build-DMWSSvxq.mjs → eas-build-CyDKNTBP.mjs} +4 -4
  52. package/dist/{eas-fallback-vKlrqxgE.mjs → eas-fallback-gaZi-dJL.mjs} +16 -15
  53. package/dist/{eas-session-ledger-BQF9Yyy9.mjs → eas-session-ledger-BMCA1gdO.mjs} +12 -8
  54. package/dist/{error-diagnostics-DYsjJIHz.mjs → error-diagnostics-B1Mj_-7h.mjs} +17 -42
  55. package/dist/{errors-ccaPc4ox.mjs → errors-DHm_U5gv.mjs} +2 -1
  56. package/dist/{exec-DEoAhcze.mjs → exec-VFRpu1iA.mjs} +116 -28
  57. package/dist/{gc-BW8E1uSC.mjs → gc-B9jcnmIk.mjs} +205 -28
  58. package/dist/{gc-dDE4QPVu.mjs → gc-eaz403W6.mjs} +2 -2
  59. package/dist/{guide-DYYEO3Wz.mjs → guide-DR0K0xW9.mjs} +328 -89
  60. package/dist/{hosted-android-xcfgCgSF.mjs → hosted-android-Bvb2-ZxD.mjs} +4 -4
  61. package/dist/{hosted-client-Bt-tndxV.mjs → hosted-client-rsRqysJc.mjs} +4 -4
  62. package/dist/{hosted-ios-y19jCYFF.mjs → hosted-ios-RtVcJH3u.mjs} +1 -1
  63. package/dist/{hosted-logs-DzJKzKlj.mjs → hosted-logs-CWKGYWNX.mjs} +11 -6
  64. package/dist/{hosted-macos-BJusKvqL.mjs → hosted-macos-d0pv9Tth.mjs} +7 -7
  65. package/dist/{hosted-native-BmQC6U_x.mjs → hosted-native-BxTizGU2.mjs} +58 -11
  66. package/dist/{idle-shutdown-CJmUOV5x.mjs → idle-shutdown-BIyfl0Zj.mjs} +10 -10
  67. package/dist/{ios-hcBpnEGk.mjs → ios-BQzvJlzw.mjs} +122 -17
  68. package/dist/{ios-CWjqfSm_.mjs → ios-BRVM8b0P.mjs} +81 -49
  69. package/dist/{ios-DTOYZGMJ.mjs → ios-Dvt97HgQ.mjs} +8 -8
  70. package/dist/{ios-xtlRHaeB.mjs → ios-ENC4sRPA.mjs} +1 -1
  71. package/dist/{ios-device-BXZ0c7Kb.mjs → ios-device-B6HK951C.mjs} +1 -1
  72. package/dist/{ios-device-DFGuwF4U.mjs → ios-device-CKSvk0bu.mjs} +3 -3
  73. package/dist/{ios-project-CSZYI1iu.mjs → ios-project-DCUDo06I.mjs} +5 -5
  74. package/dist/{ios-signing-BtAffm0A.mjs → ios-signing-4c_qXvQm.mjs} +2 -2
  75. package/dist/{ios-state-Dtw5K2aI.mjs → ios-state-CT9nV5SP.mjs} +15 -7
  76. package/dist/{js-swap-BSBHldmm.mjs → js-swap-Z9HbC4cj.mjs} +7 -6
  77. package/dist/{launch-D-zq8SHG.mjs → launch-D0lPvFFu.mjs} +49 -30
  78. package/dist/{launch-CP2wDCVd.mjs → launch-DscF1QfM.mjs} +52 -50
  79. package/dist/{logs-pNvA2hHK.mjs → logs-BsIRre8x.mjs} +16 -9
  80. package/dist/{logs-By5aw3g9.mjs → logs-Crs9y34Z.mjs} +8 -6
  81. package/dist/{macos-CPMahOC2.mjs → macos-CcUlJPMu.mjs} +1 -1
  82. package/dist/{macos-C67FZ2ft.mjs → macos-D477nfzH.mjs} +49 -42
  83. package/dist/macos-run.mjs +1 -1
  84. package/dist/maintenance-run.mjs +7 -7
  85. package/dist/{metro-DiXtA3Ty.mjs → metro-1pJgCX4U.mjs} +4 -4
  86. package/dist/{metro-gateway-CKZqKqx7.mjs → metro-gateway-Bp9gJQAN.mjs} +3 -4
  87. package/dist/{named-ports-DkEzOfzO.mjs → named-ports-BVbn8SvC.mjs} +3 -3
  88. package/dist/{native-android-_MWSs3PP.mjs → native-android-BvMizJn1.mjs} +17 -17
  89. package/dist/{native-gradle-artifact-inputs-DHFnmrVf.mjs → native-gradle-artifact-inputs-BJscK4vN.mjs} +5 -5
  90. package/dist/{native-run-Dv88i0aU.mjs → native-run-D5OJsGwA.mjs} +6 -6
  91. package/dist/{native-runtime-DBRfY_PN.mjs → native-runtime-B9w_Qyz3.mjs} +10 -9
  92. package/dist/{native-source-Y0yLhFyQ.mjs → native-source-D-4Dh4JU.mjs} +7 -4
  93. package/dist/{native-xcode-inputs-CqViUh3r.mjs → native-xcode-inputs-Cv4l-obn.mjs} +2 -2
  94. package/dist/{native-xcode-ios-vFgqL_yS.mjs → native-xcode-ios-DGrg90hE.mjs} +21 -20
  95. package/dist/offload-worker.d.mts +12 -4
  96. package/dist/offload-worker.mjs +78 -43
  97. package/dist/{operation-exec-BW0em61G.mjs → operation-exec-CUZifp6Z.mjs} +2 -25
  98. package/dist/{ownership-C5fo5Edb.mjs → ownership-jxxz-19m.mjs} +3 -3
  99. package/dist/{page-DBL2PiUU.mjs → page-CzEA_-5_.mjs} +2 -3
  100. package/dist/phone-reverses-CYb7RRAx.mjs +57 -0
  101. package/dist/{placement-log-BnGgJRRZ.mjs → placement-log-DjOXJRIH.mjs} +1 -1
  102. package/dist/{plan-placement-cr0fEU7b.mjs → plan-placement-BqKgKHCi.mjs} +3 -3
  103. package/dist/{ports-DpXjKkSV.mjs → ports-DtS1Amb0.mjs} +3 -3
  104. package/dist/{prebuild-BligW0QS.mjs → prebuild-JUaqOLpc.mjs} +14 -9
  105. package/dist/{project-DhCtQWWU.mjs → project-BiC68mIp.mjs} +21 -17
  106. package/dist/{pull-request-W1IuLXDt.mjs → pull-request-CbNlkFok.mjs} +2 -2
  107. package/dist/pull-requests.mjs +1 -1
  108. package/dist/{react-native-android-ZlhQfhvq.mjs → react-native-android-DRYqoJc4.mjs} +76 -32
  109. package/dist/{react-native-build-CelbTO_y.mjs → react-native-build-CwZB-agu.mjs} +23 -20
  110. package/dist/{react-native-doctor-LTIaP7lv.mjs → react-native-doctor-BCrytK7h.mjs} +10 -9
  111. package/dist/{react-native-ios-C5W0SA6f.mjs → react-native-ios-Cr1buNFo.mjs} +41 -24
  112. package/dist/{recordings-CQmfzAh7.mjs → recordings-BaoQ0t-J.mjs} +1 -1
  113. package/dist/{registration-BcRgF6Ox.mjs → registration-CN6nlhcD.mjs} +1 -1
  114. package/dist/{reload-QcwnYLYV.mjs → reload-Beftw2X3.mjs} +1 -1
  115. package/dist/{reload-COJWTbae.mjs → reload-FbSgMF8x.mjs} +144 -42
  116. package/dist/{remote-DR8qUERM.mjs → remote-BuZj6AyU.mjs} +16 -7
  117. package/dist/{result-utnBea7x.mjs → result-CR2vk2cj.mjs} +41 -18
  118. package/dist/{run-DidHghD1.mjs → run-BtzE09Dl.mjs} +2 -2
  119. package/dist/{selection-DSMbWEX2.mjs → selection-D5cxEl3t.mjs} +13 -7
  120. package/dist/{server-bare-CafzuyFB.mjs → server-bare-CH9X0RLn.mjs} +56 -4
  121. package/dist/{server-command-B9o92sLM.mjs → server-command-CaBbDNU2.mjs} +5 -5
  122. package/dist/server-expo-C16Zf2k7.mjs +2 -0
  123. package/dist/{server-expo-BXrWxNYh.mjs → server-expo-Ck8EIidM.mjs} +14 -9
  124. package/dist/{settings-C7O8A6ZI.mjs → settings-B5tCoq9N.mjs} +132 -39
  125. package/dist/{settings-PfJx8uK1.mjs → settings-DzH9mGQZ.mjs} +1 -1
  126. package/dist/{settings-write-Chuy7Cte.mjs → settings-write-n0zwfohx.mjs} +7 -7
  127. package/dist/settings.schema.json +51 -0
  128. package/dist/{simslim-BNckWpXi.mjs → simslim-BjxszUAb.mjs} +22 -7
  129. package/dist/{slot-launch-B7AuoWJv.mjs → slot-launch-QeuJMlnJ.mjs} +6 -6
  130. package/dist/{stage-C4u17aES.mjs → stage-D8xlRU2D.mjs} +2 -3
  131. package/dist/{start-BL_BsiWt.mjs → start-C1JLjkNw.mjs} +1 -1
  132. package/dist/{start-CU8mCPC7.mjs → start-YMpNwLhh.mjs} +75 -35
  133. package/dist/{state--smjFSTL.mjs → state-DMRNP7-4.mjs} +4 -4
  134. package/dist/{state-08I3hw3_.mjs → state-DPaM3u5K.mjs} +2 -2
  135. package/dist/{stats-CO6sK0Nh.mjs → stats-CP7STzZw.mjs} +5 -5
  136. package/dist/{stats-report-BzaPrRm6.mjs → stats-report-n2U5plhk.mjs} +1 -1
  137. package/dist/{status-_WPHzVft.mjs → status-CRLiJ-O_.mjs} +24 -24
  138. package/dist/{status-BRROykC8.mjs → status-Fect2w9R.mjs} +1 -1
  139. package/dist/{status-CrJutl6-.mjs → status-cNw6i0_t.mjs} +1 -1
  140. package/dist/{status-watch-BHFasOZN.mjs → status-watch-Bc2J4TZn.mjs} +5 -5
  141. package/dist/status-worker.mjs +1 -1
  142. package/dist/stim-clonefile.c +18 -0
  143. package/dist/{stim-desktop-D5OGpYZM.mjs → stim-desktop-DS0mzR8U.mjs} +2 -2
  144. package/dist/{stop-iuFHjUST.mjs → stop-Br7LKxBE.mjs} +2 -2
  145. package/dist/{stop-CR5689oB.mjs → stop-COP6PQqw.mjs} +5 -5
  146. package/dist/{stop-BJ06ipTZ.mjs → stop-Db9Kh-UA.mjs} +109 -56
  147. package/dist/supervisor-run.mjs +17 -17
  148. package/dist/{support-CbXPbUMJ.mjs → support-Cxj9CmII.mjs} +6 -6
  149. package/dist/{support-TWuQlHQo.mjs → support-qKcbgmI5.mjs} +14 -11
  150. package/dist/{swiftpm-artifact-inputs-DFcGsXDP.mjs → swiftpm-artifact-inputs-iY9fsmOc.mjs} +4 -4
  151. package/dist/{swiftpm-macos-DbwGCpZg.mjs → swiftpm-macos-Bp_sn9P4.mjs} +15 -14
  152. package/dist/{toolchain-XkA2PfJZ.mjs → toolchain-DB1aeqxO.mjs} +1 -1
  153. package/dist/{toolchain-B9hCFCQw.mjs → toolchain-VzLJzZ7O.mjs} +69 -37
  154. package/dist/trigger-BLsHgAGR.mjs +2 -0
  155. package/dist/{trigger-Cbyc41d_.mjs → trigger-CBMe2YLH.mjs} +2 -2
  156. package/dist/{warm-progress-CA3TgT3-.mjs → warm-progress-BV3ZPmcY.mjs} +6 -6
  157. package/dist/{web-DRF_oFXk.mjs → web-B4Yjyt1G.mjs} +12 -10
  158. package/dist/web-DS4UDWvf.mjs +2 -0
  159. package/dist/web-run.mjs +8 -9
  160. package/dist/windows-report.mjs +12 -1
  161. package/dist/windows-report.ps1 +1 -1
  162. package/dist/{workspace-state-U08dEzhG.mjs → workspace-state-CPSp3mav.mjs} +11 -4
  163. package/dist/{workspaces-e41xsjKr.mjs → workspaces-C9w4aeXF.mjs} +36 -32
  164. package/dist/{worktree-B4Nj3EGS.mjs → worktree-CclFIe1Z.mjs} +324 -99
  165. package/dist/{worktree-BEwxVwKF.mjs → worktree-Ct9Gk3KL.mjs} +1 -1
  166. package/dist/{xcode-Rq744mBF.mjs → xcode-CiIIDnuD.mjs} +42 -28
  167. package/package.json +7 -7
  168. package/shim/bundle-response.cjs +53 -1
  169. package/shim/bundle-response.d.cts +1 -1
  170. package/shim/expo-metro-config.cjs +23 -1
  171. package/dist/native-gradle-inputs-Dnh84Zbd.mjs +0 -211
  172. package/dist/server-expo-Ddr8cG_c.mjs +0 -2
  173. package/dist/trigger-yb_nFzPF.mjs +0 -2
  174. package/dist/web-kDE9Myoy.mjs +0 -2
@@ -1,33 +1,34 @@
1
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-YKGWivpG.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-DhCtQWWU.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-3ivAK99e.mjs";
8
- import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-Dv88i0aU.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-Rq744mBF.mjs";
13
- import { d as simulatorRuntime, h as setRemoteLogSink } from "./client-B4MMzfo_.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-B7AuoWJv.mjs";
18
- import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-DXPSwdbb.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-TWuQlHQo.mjs";
20
- import { r as isEasBuildFailure } from "./eas-build-DMWSSvxq.mjs";
21
- import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-DBRfY_PN.mjs";
22
- import "./dev-client-BFxiDpkf.mjs";
23
- import { t as didSetUpDevice } from "./device-CiNYxqp6.mjs";
2
+ import { B as deviceSlotFileKey, W as parseDeviceSlotOption, q as validateDeviceSlot } from "./config-BZhXY15H.mjs";
3
+ import { _ as stepTimer, g as stepClock, i as formatDuration, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
4
+ import { a as recordWorkspaceUseAsync } from "./workspace-state-CPSp3mav.mjs";
5
+ import { C as iosSigningIdentitySha1Setting, M as metroPortSetting, P as metroWarmupUrlSetting, R as projectSettingsContextAsync, S as iosSigningIdentitySettingError, _ as iosLanHostSetting, a as SETTING_SHAPE_REMEDY, g as deviceReclaimIdleMinutesSetting, it as tunnelModeSetting, v as iosLanHostSettingError, w as iosSigningIdentitySha1SettingError, x as iosSigningIdentitySetting, z as publicUrlSetting } from "./settings-B5tCoq9N.mjs";
6
+ import { L as workspaceDevServerMode, t as NO_PROJECT_REFUSAL } from "./project-BiC68mIp.mjs";
7
+ import { ft as POOL_SETTING_REMEDY, vt as parkedMaxSetting } from "./android-Cjcj8MCw.mjs";
8
+ import { G as createRunRecorder, H as startBuildProgress, Ln as exitAfterFlush, M as NO_BUILD_PROGRESS, U as tapBuildLog, V as runFailureRecord, W as thrownRunFailureRecord, Z as statsProjectKey$1, dn as DEFAULT_METRO_PORT, or as ownedSessionName, zn as runProcessOperation, zt as binOnPath } from "./budget-HyShrIpL.mjs";
9
+ import { d as runCancellationSignal, f as withNativeBuildRun, r as cancelledFailure, u as runCancellation } from "./native-run-D5OJsGwA.mjs";
10
+ import { i as createIosSimSnapshot } from "./ios-BQzvJlzw.mjs";
11
+ import { d as optimizationBuildProfile, l as artifactCachePolicy } from "./errors-DHm_U5gv.mjs";
12
+ import { t as COMPILATION_CACHE_NOT_RUN } from "./xcode-CiIIDnuD.mjs";
13
+ import { S as setRemoteLogSink, d as simulatorRuntime } from "./client-BQsmyp_-.mjs";
14
+ import { a as parseBuildMachineOption } from "./selection-D5cxEl3t.mjs";
15
+ import { r as hostedMetroSettings } from "./metro-gateway-Bp9gJQAN.mjs";
16
+ import { i as writeDevicePlacementAsync } from "./ios-state-CT9nV5SP.mjs";
17
+ import { t as devClientPortBusy } from "./hosted-native-BxTizGU2.mjs";
18
+ import { r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-QeuJMlnJ.mjs";
19
+ import { f as waitFlagConflict, o as leaseExpiryText } from "./device-lease-run-ogEeJ62K.mjs";
20
+ 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-qKcbgmI5.mjs";
21
+ import { r as isEasBuildFailure } from "./eas-build-CyDKNTBP.mjs";
22
+ import { r as isPhysicalDeviceRequest, t as ensureDevServer } from "./native-runtime-B9w_Qyz3.mjs";
23
+ import "./dev-client-CHoXXZeg.mjs";
24
+ import { t as didSetUpDevice } from "./device-B9FqTBYW.mjs";
24
25
  import { t as unsupportedPlan } from "./project-plan-BPwbLwQu.mjs";
25
- import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-BmbdHQbr.mjs";
26
- import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-CSZYI1iu.mjs";
27
- import { t as acquireIosArtifact } from "./artifact-DBI3DALs.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-DR8qUERM.mjs";
29
- import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-DFGuwF4U.mjs";
30
- import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-CP2wDCVd.mjs";
26
+ import { a as refusePlan, i as printPlan, n as planFlagRefusal } from "./build-plan-zCuHGlA8.mjs";
27
+ import { a as lastBuildRecord, o as reportIosResult, s as writeLastBuild } from "./ios-project-DCUDo06I.mjs";
28
+ import { t as acquireIosArtifact } from "./artifact-DN8JNwqS.mjs";
29
+ import { a as hostedIosSelectors, i as hostedIosMetroNote, n as connectIosTarget, o as iosPlacementBudget, r as deviceRemoteConflict, s as selectIosPlacement, t as connectIosBackend } from "./remote-BuZj6AyU.mjs";
30
+ import { a as iosPoolCandidates, c as isWirelessIosDevice, f as resolveIosPhysicalDevice, o as iosPoolNoCandidatesRefusal, r as iosDeviceBounds } from "./ios-device-CKSvk0bu.mjs";
31
+ import { i as DEFAULT_DEPS, l as lanOriginUrlFor, s as chooseLanAddress, t as finishIosRun } from "./launch-DscF1QfM.mjs";
31
32
  import { basename, join } from "node:path";
32
33
  import { workspaceId } from "@stim-cli/core";
33
34
  import { hostedIosStatus, parseMachine } from "@stim-cli/core/state";
@@ -53,6 +54,7 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
53
54
  release,
54
55
  mode: appMode,
55
56
  ...appMode === "development" && isExpo ? { devClientScheme: d.devClientScheme(root, artifact.path) ?? void 0 } : {},
57
+ metroPort,
56
58
  reserved: (placement) => d.writeHostedIos(root, slot, placement),
57
59
  note,
58
60
  enterPhase
@@ -64,8 +66,8 @@ async function finishHostedIosRun({ target, d, artifact, root, slot, release, ap
64
66
  remedy: error instanceof Error && "remedy" in error && typeof error.remedy === "string" ? error.remedy : `Retry stim ios --remote ${target.host.machine}, or run stim stop to reconcile any recorded placement.`
65
67
  });
66
68
  }
67
- d.writeHostedIos(root, slot, run.placement);
68
- d.writeWorkspaceLaunch(root, "ios", {
69
+ await d.writeHostedIos(root, slot, run.placement);
70
+ await d.writeWorkspaceLaunch(root, "ios", {
69
71
  appId: bundleId,
70
72
  deviceId: run.placement.session,
71
73
  metroPort,
@@ -207,7 +209,7 @@ function runIosOperation(context, root, opts = {}, deps = {}, onFailure = () =>
207
209
  platform: "ios",
208
210
  slot: opts.slot ?? "default"
209
211
  }, async (claim) => {
210
- recordWorkspaceUse(root, /* @__PURE__ */ new Date(), context.env, context.cwd);
212
+ await recordWorkspaceUseAsync(root, /* @__PURE__ */ new Date(), context.env, context.cwd, context.signal);
211
213
  const progress = startBuildProgress({
212
214
  root,
213
215
  platform: "ios",
@@ -407,6 +409,17 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
407
409
  let buildMachine = "auto";
408
410
  let devicePlacement;
409
411
  let builtConfiguration = null;
412
+ let acquiredBuild = null;
413
+ const recordFailedBuild = (build, errorCode) => writeLastBuild(root, lastBuildRecord({
414
+ devicePlacement,
415
+ buildMachine,
416
+ ...build,
417
+ configuration: builtConfiguration,
418
+ startedAt,
419
+ status: "failed",
420
+ errorCode,
421
+ durationMs: elapsed()
422
+ }));
410
423
  const fail = ({ retainedClaimRoots, code, message, remedy = null, lines = [], logPath = null, build = null, lease, setup = false }) => {
411
424
  ({code, message, remedy, lines} = cancelledFailure(context, "ios", {
412
425
  code,
@@ -422,15 +435,12 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
422
435
  for (const line of lines) note(chalk.dim(phaseLine("", line)));
423
436
  if (remedy) note(chalk.dim(phaseLine("remedy", remedy)));
424
437
  if (logPath) note(chalk.dim(phaseLine("log", logPath)));
425
- if (build) writeLastBuild(root, lastBuildRecord({
426
- devicePlacement,
427
- buildMachine,
428
- ...build,
429
- configuration: builtConfiguration,
430
- startedAt,
431
- status: "failed",
432
- errorCode: code,
433
- durationMs: elapsed()
438
+ const failedBuild = build ?? acquiredBuild;
439
+ if (failedBuild) recordFailedBuild(failedBuild, code);
440
+ if (acquiredBuild) logWriter().write(runFailureRecord({
441
+ code,
442
+ message,
443
+ phase: progress.phase()
434
444
  }));
435
445
  note(chalk.red(phaseLine("failed", code)));
436
446
  if (!setup) recordRun({
@@ -554,6 +564,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
554
564
  easProfile: opts.easProfile
555
565
  });
556
566
  if (capabilityRefusal) return fail(capabilityRefusal);
567
+ const simSnapshot = createIosSimSnapshot();
557
568
  const remoteSelection = await selectIosPlacement({
558
569
  root,
559
570
  env: context.env,
@@ -580,8 +591,10 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
580
591
  deviceTypeOrigin: d.settingOriginScope(d.settingsLayers(settingsContext), "ios.deviceType"),
581
592
  runtimeOrigin: d.settingOriginScope(d.settingsLayers(settingsContext), "ios.runtime"),
582
593
  listRuntimes: d.listIosRuntimes,
583
- signal: context.signal
594
+ signal: context.signal,
595
+ snapshot: simSnapshot
584
596
  }),
597
+ simSnapshot,
585
598
  noWait: deviceSlotWaitMs === 0,
586
599
  note,
587
600
  phase,
@@ -595,7 +608,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
595
608
  });
596
609
  if (targetRefusal) return fail(targetRefusal);
597
610
  devicePlacement = remoteSelection.devicePlacement;
598
- writeDevicePlacement(root, slot, "ios", devicePlacement);
611
+ await writeDevicePlacementAsync(root, slot, "ios", devicePlacement);
599
612
  const { machine: hostedMachine, backend: remoteBackend } = remoteSelection;
600
613
  const viewer = resolveSimulatorAppFlag(opts.simulatorApp, physical, hostedMachine ?? remoteBackend, Boolean(remoteSelection.auto));
601
614
  if ("refusal" in viewer) return fail(viewer.refusal);
@@ -613,7 +626,8 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
613
626
  remoteBackend,
614
627
  hosted: Boolean(hostedMachine),
615
628
  listRuntimes: d.listIosRuntimes,
616
- signal: context.signal
629
+ signal: context.signal,
630
+ snapshot: simSnapshot
617
631
  });
618
632
  if (modelRefusal) return fail(modelRefusal);
619
633
  const selectors = hostedIosSelectors(deviceType, runtime);
@@ -621,7 +635,6 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
621
635
  if ("failure" in connected) return fail(connected.failure);
622
636
  const hostedTarget = connected.target;
623
637
  try {
624
- const simSnapshot = createIosSimSnapshot();
625
638
  const budget = await iosPlacementBudget(d, root, note, Boolean(hostedTarget), remoteSelection.budget, simSnapshot, context.env);
626
639
  reclaimed = budget.reclaimed;
627
640
  if (budget.refusal) return fail(budget.refusal);
@@ -800,6 +813,11 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
800
813
  }
801
814
  async function prepareMetro() {
802
815
  if (metroCheck) {
816
+ const hostedPorts = hostedTarget && isExpo && d.hasDevClient(root) ? {
817
+ machine: hostedTarget.host.machine,
818
+ free: d.hostedMetroPortProbe(hostedTarget.host.machine, note),
819
+ busy: (port) => devClientPortBusy(hostedTarget.host.machine, port)
820
+ } : void 0;
803
821
  const gate = await ensureDevServer({
804
822
  env: context.env,
805
823
  root,
@@ -807,6 +825,7 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
807
825
  settings: hostedMetroSettings(settings, Boolean(hostedTarget)),
808
826
  settingsContext,
809
827
  remote: Boolean(remoteDevice),
828
+ hostedPorts,
810
829
  note,
811
830
  resolve: d.resolveProjectMetro,
812
831
  start: d.startDevServer,
@@ -825,6 +844,10 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
825
844
  };
826
845
  metroPort = gate.port;
827
846
  devServer = gate.devServer;
847
+ if (hostedPorts && !await hostedPorts.free(gate.port)) return {
848
+ ok: false,
849
+ error: devClientPortBusy(hostedPorts.machine, gate.port)
850
+ };
828
851
  } else {
829
852
  const pin = metroPortSetting(settings, context.env);
830
853
  if (pin.error) return {
@@ -870,7 +893,9 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
870
893
  platform: "ios",
871
894
  isExpo,
872
895
  appId: proj?.bundleId,
873
- bundleUrl: metroWarmupUrlSetting(settings, "ios")
896
+ bundleUrl: metroWarmupUrlSetting(settings, "ios"),
897
+ logsDir,
898
+ root
874
899
  });
875
900
  return {
876
901
  ok: true,
@@ -917,10 +942,12 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
917
942
  code: "STIM_CANCELLED",
918
943
  message: "while finishing the run"
919
944
  });
920
- if (cancelled) return fail({
921
- ...cancelled,
922
- build: artifact?.failureFields
923
- });
945
+ if (cancelled) return fail(cancelled);
946
+ if (acquiredBuild) {
947
+ const { code } = error;
948
+ recordFailedBuild(acquiredBuild, typeof code === "string" ? code : void 0);
949
+ logWriter().write(thrownRunFailureRecord(error, progress.phase()));
950
+ }
924
951
  recordRun({
925
952
  failed: true,
926
953
  durationMs: elapsed()
@@ -1034,6 +1061,11 @@ async function runIos(context, projectRoot, opts = {}, overrides = {}, progress
1034
1061
  return fail(acquiredArtifact.failure);
1035
1062
  }
1036
1063
  artifact = acquiredArtifact.artifact;
1064
+ acquiredBuild = {
1065
+ ...artifact.failureFields,
1066
+ appPath: artifact.path,
1067
+ bundleId: artifact.bundleId
1068
+ };
1037
1069
  compilationCache = artifact.cache.compilation;
1038
1070
  if (hostedTarget) return await finishHostedIosRun({
1039
1071
  output: context.output,
@@ -1,9 +1,9 @@
1
- import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-YKGWivpG.mjs";
2
- import { jn as schemesFromInfoPlist, kn as pickDevClientScheme } from "./budget-3ivAK99e.mjs";
3
- import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-TWuQlHQo.mjs";
4
- import { n as ensureWorkspaceStorageSafely } from "./native-runtime-DBRfY_PN.mjs";
5
- import { t as devClientScheme } from "./dev-client-BFxiDpkf.mjs";
6
- import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-CSZYI1iu.mjs";
7
- import { n as registerIos, r as runIosOperation, t as iosCommand } from "./ios-CWjqfSm_.mjs";
8
- import { a as collectorEntry, o as replaceCollector } from "./launch-CP2wDCVd.mjs";
1
+ import { h as shortUdid, i as formatDuration, l as phaseLine, m as shortHash } from "./command-output-BBvS1H6v.mjs";
2
+ import { Mn as pickDevClientScheme, Pn as schemesFromInfoPlist } from "./budget-HyShrIpL.mjs";
3
+ import { f as podAction, h as resolveDeviceType, i as deviceLabel, m as resolveConfiguration, n as buildLogFile, s as iosConfigurationSetting, t as appNameFromPath, u as isReleaseConfiguration, v as resolveRuntime } from "./support-qKcbgmI5.mjs";
4
+ import { n as ensureWorkspaceStorageSafely } from "./native-runtime-B9w_Qyz3.mjs";
5
+ import { t as devClientScheme } from "./dev-client-CHoXXZeg.mjs";
6
+ import { a as lastBuildRecord, i as iosFacts, n as cacheDescription, s as writeLastBuild } from "./ios-project-DCUDo06I.mjs";
7
+ import { n as registerIos, r as runIosOperation, t as iosCommand } from "./ios-BRVM8b0P.mjs";
8
+ import { a as collectorEntry, o as replaceCollector } from "./launch-DscF1QfM.mjs";
9
9
  export { appNameFromPath, buildLogFile, cacheDescription, collectorEntry, iosCommand as default, devClientScheme, deviceLabel, ensureWorkspaceStorageSafely, formatDuration, iosConfigurationSetting, iosFacts, isReleaseConfiguration, lastBuildRecord, phaseLine, pickDevClientScheme, podAction, registerIos, replaceCollector, resolveConfiguration, resolveDeviceType, resolveRuntime, runIosOperation, schemesFromInfoPlist, shortHash, shortUdid, writeLastBuild };
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
2
  //#region src/collector/ios.ts
3
3
  const MESSAGE_TYPE_LEVEL = {
4
4
  Debug: "debug",
@@ -1,4 +1,4 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
2
  //#region src/collector/ios-device.ts
3
3
  const CONSOLE_ENV = { OS_ACTIVITY_DT_MODE: "enable" };
4
4
  const DEV_MENU_LAUNCH_ARGS = [
@@ -1,6 +1,6 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { ln as INSTALL_ERROR, pn as appProcessFromPid } from "./budget-3ivAK99e.mjs";
3
- import { n as TOOL_ERROR_PREFIX } from "./ios-device-BXZ0c7Kb.mjs";
1
+ import { t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { fn as INSTALL_ERROR, gn as appProcessFromPid } from "./budget-HyShrIpL.mjs";
3
+ import { n as TOOL_ERROR_PREFIX } from "./ios-device-B6HK951C.mjs";
4
4
  import { mkdtempSync, readFileSync, rmSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
6
6
  import { join } from "node:path";
@@ -1,9 +1,9 @@
1
1
  import { l as workspaceAgentDeviceDir } from "./paths-DQtTgsBf.mjs";
2
- import { i as formatDuration, l as phaseLine } from "./command-output-YKGWivpG.mjs";
3
- import { B as recordFinishedBuild, Hn as isEasAuthFailureText, Rn as UPLOAD_TIMEOUT_MS, Vn as easAuthNote, zn as cacheLevel } from "./budget-3ivAK99e.mjs";
4
- import { a as workspaceLinkLine } from "./stim-desktop-D5OGpYZM.mjs";
5
- import { o as compilationCacheActivityLine, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-Rq744mBF.mjs";
6
- import { i as deviceLabel } from "./support-TWuQlHQo.mjs";
2
+ import { i as formatDuration, l as phaseLine } from "./command-output-BBvS1H6v.mjs";
3
+ import { a as workspaceLinkLine } from "./stim-desktop-DS0mzR8U.mjs";
4
+ import { B as recordFinishedBuild, Gn as isEasAuthFailureText, Hn as cacheLevel, Vn as UPLOAD_TIMEOUT_MS, Wn as easAuthNote } from "./budget-HyShrIpL.mjs";
5
+ import { o as compilationCacheActivityLine, t as COMPILATION_CACHE_NOT_RUN } from "./xcode-CiIIDnuD.mjs";
6
+ import { i as deviceLabel } from "./support-qKcbgmI5.mjs";
7
7
  import { buildDiagnostics } from "@stim-cli/core/state";
8
8
  import chalk from "chalk";
9
9
  //#region src/commands/ios/result.ts
@@ -1,5 +1,5 @@
1
- import { t as getExecutor } from "./exec-DEoAhcze.mjs";
2
- import { a as killOnAbort, f as throwIfCancelled, r as childEnvironment } from "./operation-exec-BW0em61G.mjs";
1
+ import { c as throwIfCancelled, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
+ import { a as killOnAbort, r as childEnvironment } from "./operation-exec-CUZifp6Z.mjs";
3
3
  import { X509Certificate } from "node:crypto";
4
4
  import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
@@ -1,4 +1,4 @@
1
- import { o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-U08dEzhG.mjs";
1
+ import { l as withWorkspaceStateLockAsync, o as updateWorkspaceState, r as readWorkspaceState$1 } from "./workspace-state-CPSp3mav.mjs";
2
2
  import { HOSTED_METRO_REQUESTS_KEY, hostedMetroRequests, hostedNativeRecords, isJsonObject, parseHostedNativePlacement, unreadableHostedNative } from "@stim-cli/core/state";
3
3
  //#region src/device-host/ios-state.ts
4
4
  function readHostedNative(root, platform, slot) {
@@ -42,6 +42,10 @@ function writeDevicePlacement(root, slot, platform, placement) {
42
42
  };
43
43
  });
44
44
  }
45
+ /** Records the device placement after asynchronously acquiring the workspace state lock; no placement takes no lock. */
46
+ async function writeDevicePlacementAsync(root, slot, platform, placement) {
47
+ if (placement) await withWorkspaceStateLockAsync(root, () => writeDevicePlacement(root, slot, platform, placement));
48
+ }
45
49
  function writeHostedNative(root, slot, host, platform) {
46
50
  updateWorkspaceState(root, (state) => {
47
51
  const slots = isJsonObject(state.deviceSlots) ? state.deviceSlots : {};
@@ -76,14 +80,18 @@ function writeHostedNative(root, slot, host, platform) {
76
80
  function readHostedIos(root, slot) {
77
81
  return readHostedNative(root, "ios", slot);
78
82
  }
79
- function writeHostedIos(root, slot, host) {
80
- writeHostedNative(root, slot, host, "ios");
83
+ /** Records a hosted placement after asynchronously acquiring the workspace state lock. */
84
+ function writeHostedNativeAsync(root, slot, host, platform) {
85
+ return withWorkspaceStateLockAsync(root, () => writeHostedNative(root, slot, host, platform));
86
+ }
87
+ function writeHostedIosAsync(root, slot, host) {
88
+ return writeHostedNativeAsync(root, slot, host, "ios");
89
+ }
90
+ function writeHostedAndroidAsync(root, slot, host) {
91
+ return writeHostedNativeAsync(root, slot, host, "android");
81
92
  }
82
93
  function readHostedAndroid(root, slot) {
83
94
  return readHostedNative(root, "android", slot);
84
95
  }
85
- function writeHostedAndroid(root, slot, host) {
86
- writeHostedNative(root, slot, host, "android");
87
- }
88
96
  //#endregion
89
- export { writeHostedAndroid as a, writeDevicePlacement as i, readHostedIos as n, writeHostedIos as o, readHostedNative as r, writeHostedNative as s, readHostedAndroid as t };
97
+ export { writeHostedAndroidAsync as a, writeHostedNativeAsync as c, writeDevicePlacementAsync as i, readHostedIos as n, writeHostedIosAsync as o, readHostedNative as r, writeHostedNative as s, readHostedAndroid as t };
@@ -1,10 +1,10 @@
1
- import { d as spawnDeclared, m as operationState, t as getExecutor } from "./exec-DEoAhcze.mjs";
1
+ import { _ as spawnDeclared, b as operationState, c as throwIfCancelled, t as getExecutor } from "./exec-VFRpu1iA.mjs";
2
2
  import { r as waitForChild, t as createLineReader } from "./process-output-Fpl8PYi8.mjs";
3
- import { a as killOnAbort, f as throwIfCancelled, t as runOperationFile } from "./operation-exec-BW0em61G.mjs";
4
- import { Ht as makeTemporaryDirectory, Ut as removeTemporaryEntry } from "./settings-C7O8A6ZI.mjs";
5
- import { Xn as bundleInvocation } from "./budget-3ivAK99e.mjs";
6
- import { t as cleanLine } from "./server-expo-BXrWxNYh.mjs";
7
- import { _ as tailLines, h as startBuildHeartbeat, r as HEARTBEAT_INTERVAL_MS } from "./xcode-Rq744mBF.mjs";
3
+ import { a as killOnAbort, t as runOperationFile } from "./operation-exec-CUZifp6Z.mjs";
4
+ import { Ut as makeTemporaryDirectory, Wt as removeTemporaryEntry } from "./settings-B5tCoq9N.mjs";
5
+ import { $n as bundleInvocation } from "./budget-HyShrIpL.mjs";
6
+ import { s as expoTelemetryEnv, t as cleanLine } from "./server-expo-Ck8EIidM.mjs";
7
+ import { _ as tailLines, h as startBuildHeartbeat, r as HEARTBEAT_INTERVAL_MS } from "./xcode-CiIIDnuD.mjs";
8
8
  import { randomUUID } from "node:crypto";
9
9
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
10
10
  import { basename, join } from "node:path";
@@ -312,6 +312,7 @@ async function swapJsBundle({ context, root, iosDir, isExpo, cachedAppPath, logW
312
312
  ],
313
313
  env: {
314
314
  ...context?.env ?? process.env,
315
+ ...expoTelemetryEnv(context?.env ?? process.env),
315
316
  FORCE_COLOR: "0"
316
317
  }
317
318
  }));
@@ -1,21 +1,22 @@
1
1
  import { m as workspaceLogsDir } from "./paths-DQtTgsBf.mjs";
2
- import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } from "./config-DlrsduwG.mjs";
3
- import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-YKGWivpG.mjs";
4
- import { L as workspaceDevServerMode } from "./project-DhCtQWWU.mjs";
5
- import { c as pidExists, f as signalProcessTree } from "./metro-DiXtA3Ty.mjs";
6
- import { En as restartedAppNote, Jt as LAUNCH_FATAL, Xt as RELEASE_VERIFY_WAIT_MS, Yt as LAUNCH_UNVERIFIED, Zt as VERIFY_TIMEOUT_MS, bn as installConflictKind, dn as androidAppProcess, fn as androidDevClientUrl, nn as unverifiedLaunchLines, qt as LAUNCH_BUNDLING, sn as ADB_INSTALL_TIMEOUT_MS, tn as unattributedLaunchLines } from "./budget-3ivAK99e.mjs";
7
- import { D as teardownOwnedAvd } from "./workspaces-e41xsjKr.mjs";
8
- import { p as providerUploadOutcome } from "./build-cache-Dv7RN200.mjs";
9
- import { $ as resetAdoptedAvd, i as androidDataFreeBytes, it as trimAndroidCaches, u as androidToolCwd } from "./android-C7sVmyI9.mjs";
10
- import { o as workspaceLinks } from "./stim-desktop-D5OGpYZM.mjs";
11
- import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-C5fo5Edb.mjs";
12
- import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-B7AuoWJv.mjs";
2
+ import { B as deviceSlotFileKey, C as saveConfig, E as upsertProject, H as deviceSlotPlatforms, O as withConfigLockAsync, P as formatBytes, V as deviceSlotKey, _ as loadConfig, w as setDevice } from "./config-BZhXY15H.mjs";
3
+ import { _ as stepTimer, c as launchErrorReport, i as formatDuration, l as phaseLine, n as appReadinessMessage, v as launchErrorPreview } from "./command-output-BBvS1H6v.mjs";
4
+ import { L as workspaceDevServerMode } from "./project-BiC68mIp.mjs";
5
+ import { o as workspaceLinks } from "./stim-desktop-DS0mzR8U.mjs";
6
+ import { i as androidDataFreeBytes, ot as trimAndroidCaches, tt as resetAdoptedAvd, u as androidToolCwd } from "./android-Cjcj8MCw.mjs";
7
+ import { c as pidExists, f as signalProcessTree } from "./metro-1pJgCX4U.mjs";
8
+ import { $t as RELEASE_VERIFY_WAIT_MS, Cn as installConflictKind, Xt as LAUNCH_FATAL, Yt as LAUNCH_BUNDLING, Zt as LAUNCH_UNVERIFIED, an as unverifiedLaunchLines, en as VERIFY_TIMEOUT_MS, hn as androidDevClientUrl, in as unattributedLaunchLines, kn as restartedAppNote, mn as androidAppProcess, un as ADB_INSTALL_TIMEOUT_MS } from "./budget-HyShrIpL.mjs";
9
+ import { O as teardownOwnedAvd } from "./workspaces-C9w4aeXF.mjs";
10
+ import { _ as providerUploadOutcome } from "./build-cache-CKCzxzxA.mjs";
11
+ import { n as verifyCollectorOwnership, r as readCollectors } from "./ownership-jxxz-19m.mjs";
12
+ import { t as recordPhoneReverse } from "./phone-reverses-CYb7RRAx.mjs";
13
+ import { n as nativeRunCommand, r as siblingPlatformSlots, t as launchSlotScope } from "./slot-launch-QeuJMlnJ.mjs";
13
14
  import { t as spawnEntry } from "./spawn-entry-jw19m8Nl.mjs";
14
- import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-DXPSwdbb.mjs";
15
- import { a as printNativeCrashReport, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-DYsjJIHz.mjs";
16
- import { i as launchOutcomeRecord } from "./native-runtime-DBRfY_PN.mjs";
17
- import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-CbXPbUMJ.mjs";
18
- import { a as reportAndroidResult, i as persistLastBuild, n as finishAndroidUpload } from "./result-utnBea7x.mjs";
15
+ import { c as lostRefusal, s as lostLine, t as DEBUG_VERIFY_STEP_MS } from "./device-lease-run-ogEeJ62K.mjs";
16
+ import { a as printNativeCrashReport, r as captureNativeCrashes, t as errorDiagnostics } from "./error-diagnostics-B1Mj_-7h.mjs";
17
+ import { i as launchOutcomeRecord } from "./native-runtime-B9w_Qyz3.mjs";
18
+ import { a as PLATFORM, b as noDeviceDiagnostic, h as displayPath, n as LAUNCH_FAILED, r as NO_DEVICE, t as INSTALL_FAILED } from "./support-Cxj9CmII.mjs";
19
+ import { a as persistLastBuild, n as finishAndroidUpload, s as reportAndroidResult } from "./result-CR2vk2cj.mjs";
19
20
  import { mkdirSync, openSync, statSync } from "node:fs";
20
21
  import { basename, join } from "node:path";
21
22
  import { ambientEnv } from "@stim-cli/core";
@@ -240,21 +241,15 @@ async function verifyAndroidMetroRun({ operation, root, slot, remoteDevice, veri
240
241
  for (const line of launchErrorPreview(verification.errors ?? [], root)) phase("", chalk.red(line));
241
242
  if (verification.processAlive === false && !verification.errors?.some((record) => record.event === "native_crash")) phase("logs", "No attributable native crash report captured yet. Run `stim logs --errors` again for delayed reports, or `stim logs --source device` for available output.");
242
243
  if (nativeFatal || verification.processAlive === false) phase("remedy", chalk.yellow(`Fix the crash, then run \`${runCommand}\` again; it force-stops a crashed process that remains alive behind the system crash dialog. Metro reload cannot recover it.`));
243
- else if (verification.processAlive === true && metroPort !== null) {
244
- const reloadRemedy = physical ? `run \`agent-device metro reload --metro-port ${metroPort}\`.` : "run `stim reload android`.";
245
- phase("remedy", chalk.yellow(`The native app is still running. ${deliveryFailed ? "Check the Metro logs and device connection, then" : "Fix the JavaScript or TypeScript error, then"} ${reloadRemedy} Do not run \`${runCommand}\` unless native inputs changed or the app process exits.`));
246
- }
244
+ else if (verification.processAlive === true && metroPort !== null) phase("remedy", chalk.yellow(`The native app is still running. ${deliveryFailed ? "Check the Metro logs and device connection, then" : "Fix the JavaScript or TypeScript error, then"} run \`stim reload android\`. Do not run \`${runCommand}\` unless native inputs changed or the app process exits.`));
247
245
  return { state: LAUNCH_FATAL };
248
246
  }
249
247
  if (verification?.verified) {
250
- phase("verify", `bundle loaded` + (verification.processAlive === true ? ", process alive" : "") + (verification.readiness ? "" : ", stable for 3s -- the first screen may still be rendering") + ` (${formatDuration(verification.waitedMs ?? 0)} total)`);
248
+ phase("verify", `bundle loaded` + (verification.processAlive === true ? ", process alive" : "") + (verification.readiness ? "" : verification.jsRunning ? ", app JavaScript running -- the first screen may still be rendering" : ", stable for 3s -- the first screen may still be rendering") + ` (${formatDuration(verification.waitedMs ?? 0)} total)`);
251
249
  const report = launchErrorReport(verification.errors ?? [], root);
252
250
  if (report.summary) phase("launch", chalk.dim(report.summary));
253
251
  for (const line of report.lines) phase("launch", chalk.yellow(line));
254
- if (report.lines.length > 0 && verification.processAlive === true && metroPort !== null) {
255
- const reloadRemedy = physical ? `run \`agent-device metro reload --metro-port ${metroPort}\`.` : "run `stim reload android`.";
256
- phase("remedy", chalk.yellow(`The native app is still running. Fix the JavaScript or TypeScript error; Fast Refresh should apply the edit. If the error screen remains, ${reloadRemedy} Do not run \`${runCommand}\` unless native inputs changed or the app process exits.`));
257
- }
252
+ if (report.lines.length > 0 && verification.processAlive === true && metroPort !== null) phase("remedy", chalk.yellow(`The native app is still running. Fix the JavaScript or TypeScript error; Fast Refresh should apply the edit. If the error screen remains, run \`stim reload android\`. Do not run \`${runCommand}\` unless native inputs changed or the app process exits.`));
258
253
  return {
259
254
  state: true,
260
255
  warning: report.lines.length > 0 ? "app errors detected; inspect the error above" : verification.readiness === "timed-out" || verification.readiness === "error" ? "app readiness not confirmed; inspect the UI and logs" : void 0
@@ -315,7 +310,7 @@ async function wipeAdoptedAvd(room, free) {
315
310
  if (wiped.status !== "torn-down") throw new Error(`could not wipe it: ${wiped.reason ?? wiped.status}`);
316
311
  const rebooted = await room.rebootDevice();
317
312
  if (!rebooted.ok || !rebooted.serial) throw new Error(`it did not boot after its user data was wiped: ${rebooted.reason ?? "no serial"}`);
318
- if ((await room.resolveAvdSerial(room.avdName)).serial !== rebooted.serial) throw new Error(`${rebooted.serial} is not running ${room.avdName} after the wipe`);
313
+ if ((await room.resolveAvdSerial(room.avdName, { preferredSerial: rebooted.serial })).serial !== rebooted.serial) throw new Error(`${rebooted.serial} is not running ${room.avdName} after the wipe`);
319
314
  room.phase("device", `${room.avdName} (${rebooted.serial}) booted with wiped user data`);
320
315
  return rebooted.serial;
321
316
  }
@@ -353,13 +348,19 @@ async function installOnAdoptedAvd(room, serial, installApk) {
353
348
  }
354
349
  async function resolveInstallSerial({ root, slot, device, physical, remoteDevice, serial, resolveAvdSerial, waitForDeviceBoot, phase }) {
355
350
  if (physical || remoteDevice || !device.owned || !device.avdName) return serial;
356
- const resolved = await resolveAvdSerial(device.avdName, { timeoutMs: 5e3 });
351
+ const resolved = await resolveAvdSerial(device.avdName, {
352
+ timeoutMs: 5e3,
353
+ preferredSerial: serial
354
+ });
357
355
  if (!resolved.serial) throw new Error(`Could not verify a running owned AVD ${device.avdName} before installation.`);
358
356
  if (resolved.serial !== serial) {
359
357
  phase("device", `${device.avdName} changed serial (${serial} -> ${resolved.serial}); checking readiness before installation`);
360
358
  const ready = await waitForDeviceBoot(resolved.serial, 6e4, { commandTimeoutMs: 5e3 });
361
359
  if (!ready.ok) throw new Error(`Emulator ${resolved.serial} never reported boot completion. Diagnostic: ${JSON.stringify(ready.diagnostic)}`);
362
- if ((await resolveAvdSerial(device.avdName, { timeoutMs: 5e3 })).serial !== resolved.serial) throw new Error(`Could not verify AVD ${device.avdName} still runs on ${resolved.serial} after checking readiness.`);
360
+ if ((await resolveAvdSerial(device.avdName, {
361
+ timeoutMs: 5e3,
362
+ preferredSerial: resolved.serial
363
+ })).serial !== resolved.serial) throw new Error(`Could not verify AVD ${device.avdName} still runs on ${resolved.serial} after checking readiness.`);
363
364
  phase("device", `reopen agent-device on ${resolved.serial}`);
364
365
  }
365
366
  const consolePort = Number(resolved.serial.replace(/^emulator-/, ""));
@@ -499,7 +500,7 @@ async function finishAndroidRun({ operation, runtime, runtimePreparation, lease,
499
500
  msg: installed.note
500
501
  });
501
502
  }
502
- if (androidPackage) upsertProject(root, { androidPackage });
503
+ if (androidPackage) await withConfigLockAsync(() => upsertProject(root, { androidPackage }));
503
504
  record.bundleId = androidPackage;
504
505
  if (!androidPackage) return fail(LAUNCH_FAILED, "Could not determine this app's Android package name, so there is nothing to launch.", packageRemedy, { lastBuildStatus: true });
505
506
  if (physical) raiseLeaseFor(0, false);
@@ -520,6 +521,15 @@ async function finishAndroidRun({ operation, runtime, runtimePreparation, lease,
520
521
  physical,
521
522
  msg: `launching ${androidPackage} on ${serial}`
522
523
  });
524
+ await notePhoneReverse({
525
+ root,
526
+ slot,
527
+ serial,
528
+ metroPort,
529
+ physical,
530
+ remoteDevice,
531
+ runtimeKind: runtime.kind
532
+ }, out);
523
533
  const launched = await runtime.launch(runtimePreparation, {
524
534
  serial,
525
535
  androidPackage,
@@ -548,7 +558,7 @@ async function finishAndroidRun({ operation, runtime, runtimePreparation, lease,
548
558
  });
549
559
  phase("launch", `${androidPackage}${restartedAppNote(launched.restartedPid)} ${launchTimer()}`);
550
560
  if (!physical && !remoteDevice) try {
551
- writeLaunch(root, "android", {
561
+ await writeLaunch(root, "android", {
552
562
  appId: androidPackage,
553
563
  deviceId: serial,
554
564
  metroPort,
@@ -705,6 +715,15 @@ function localInstallRemedy({ reason, packageName, serial, useBuildCache }) {
705
715
  function launchRemedy(remoteDevice, serial, packageName) {
706
716
  return remoteDevice?.failureRemedy() ?? `Check the app installed correctly (\`adb -s ${serial} shell pm list packages ${packageName}\`).`;
707
717
  }
718
+ async function notePhoneReverse(args, out) {
719
+ const { root, slot = "default", serial, metroPort } = args;
720
+ if (!args.physical || args.remoteDevice || args.runtimeKind !== "metro" || typeof metroPort !== "number") return;
721
+ try {
722
+ await recordPhoneReverse(root, slot, serial, metroPort);
723
+ } catch (error) {
724
+ out(phaseLine("state", chalk.yellow(`could not record the adb reverse on ${serial}: ${error instanceof Error ? error.message : error}`)));
725
+ }
726
+ }
708
727
  function reportMetroRoute({ launched, remote, metroPort, androidPackage, serial, phase, writer }) {
709
728
  if (remote) {
710
729
  phase("metro", `public origin ${launched.jsLocation}`);